| | |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.tms.entity.InStoreDetail; |
| | | import org.jeecg.modules.tms.entity.ToolsClassify; |
| | | import org.jeecg.modules.tms.service.IInStoreDetailService; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | * @param inStoreDetail |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @param query |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "入库明细-分页列表查询") |
| | | @ApiOperation(value="入库明细-分页列表查询", notes="入库明细-分页列表查询") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<InStoreDetail>> queryPageList(InStoreDetail inStoreDetail, |
| | | public Result<?> findPageList(InStoreDetail inStoreDetail, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<InStoreDetail> queryWrapper = QueryGenerator.initQueryWrapper(inStoreDetail, req.getParameterMap()); |
| | | Page<InStoreDetail> page = new Page<InStoreDetail>(pageNo, pageSize); |
| | | IPage<InStoreDetail> pageList = inStoreDetailService.page(page, queryWrapper); |
| | | @RequestParam Map<String, String> query) { |
| | | IPage<Map<String, Object>> pageList = inStoreDetailService.findPageList(pageNo, pageSize, query); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | |
| | | @Excel(name = "工具编号", width = 15) |
| | | @ApiModelProperty(value = "工具编号") |
| | | private String toolId; |
| | | /**工具入库方式*/ |
| | | @Excel(name = "工具入库方式", width = 15) |
| | | @ApiModelProperty(value = "工具入库方式") |
| | | /**工具入库类型*/ |
| | | @Excel(name = "工具入库类型", width = 15) |
| | | @ApiModelProperty(value = "工具入库类型") |
| | | @Dict(dicCode = "in_storehouse_type") |
| | | private String inStorehouseType; |
| | | /**库位号*/ |
| | | @Excel(name = "库位号", width = 15) |
| | |
| | | 2.手工操作*/ |
| | | @Excel(name = "入库操作方式;1.按申请单 2.手工操作", width = 15) |
| | | @ApiModelProperty(value = "入库操作方式;1.按申请单 2.手工操作") |
| | | @Dict(dicCode = "inbound_operate_type") |
| | | private java.lang.String operateType; |
| | | /**入库时间*/ |
| | | @Excel(name = "入库时间", width = 15, format = "yyyy-MM-dd") |
| | |
| | | package org.jeecg.modules.tms.mapper; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.InStoreDetail; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | */ |
| | | public interface InStoreDetailMapper extends BaseMapper<InStoreDetail> { |
| | | |
| | | public IPage<Map<String, Object>> findPageList(IPage<Map> pageData, @Param(Constants.WRAPPER) Wrapper<Map> wrapper); |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.tms.mapper.InStoreDetailMapper"> |
| | | |
| | | <select id="queryPageList" resultType="map" parameterType="String"> |
| | | SELECT |
| | | t.id, |
| | | t.tool_id onlyCode, |
| | | t.in_storehouse_type inStorehouseType, |
| | | t.goods_shelves_id goodsShelvesId, |
| | | t.in_number inNumber, |
| | | t.in_storehouse_id inStorehouseId, |
| | | t.inbound_time inboundTime, |
| | | t.create_by createBy, |
| | | t.create_time createTime, |
| | | t.update_by updateBy, |
| | | t.update_time updateTime, |
| | | t1.tool_code toolCode, |
| | | t1.chinese_name chineseName, |
| | | t1.tool_model toolModel, |
| | | t2.classify_id classifyNum, |
| | | t3.inbound_num inboundNum, |
| | | t3.application_reason applicationReason, |
| | | t3.approval_date approvalDate, |
| | | t3.approval_opinion approvalOpinion, |
| | | t4.item_text operateType, |
| | | t5.realname handler, |
| | | t6.realname reviewer, |
| | | t7.item_value inStatus, |
| | | t8.item_value orderStatus |
| | | FROM tms_in_store_detail t |
| | | LEFT JOIN tms_base_tools t1 on t.tool_code = t1.id |
| | | LEFT JOIN tms_tools_classify t2 on t2.id = t1.classify_id |
| | | LEFT JOIN tms_inbound_order t3 on t3.id = t.in_storehouse_id |
| | | LEFT JOIN (select * from v_sys_dict where dict_code='inbound_operate_type') t4 on t4.item_value = t.operate_type |
| | | LEFT JOIN sys_user t5 on t5.username = t3.handler |
| | | LEFT JOIN sys_user t6 on t6.username = t3.reviewer |
| | | LEFT JOIN (select * from v_sys_dict where dict_code='in_status') t7 on t7.item_value = t3.in_status |
| | | LEFT JOIN (select * from v_sys_dict where dict_code='in_bill_status') t8 on t8.item_value = t3.order_status |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | t1.id, |
| | | t3.id toolCodeId, |
| | | t1.in_storage_quantity inStorageQuantity, |
| | | t1.in_actual_count inActualCount, |
| | | t3.tool_code toolCode, |
| | | t3.chinese_name chineseName, |
| | | t3.tool_model toolModel, |
| | | t5.item_text applicationType |
| | | t5.item_text applicationType, |
| | | t6.classify_id classifyNum |
| | | from tms_inbound_detail t1 |
| | | left join tms_inbound_order t2 on t1.in_storehouse_id = t2.id |
| | | left join tms_base_tools t3 on t3.id = t1.tool_code |
| | | left join tms_tools_config_property t4 on t4.tool_code = t1.tool_code |
| | | left join (select * from v_sys_dict where dict_code = 'application_type') t5 on t5.item_value = t4.application_type |
| | | left join tms_tools_classify t6 on t6.id = t3.classify_id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | package org.jeecg.modules.tms.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.jeecg.modules.tms.entity.InStoreDetail; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: 入库明细 |
| | |
| | | */ |
| | | public interface IInStoreDetailService extends IService<InStoreDetail> { |
| | | |
| | | IPage<Map<String, Object>> findPageList(Integer pageNo, Integer pageSize, Map<String, String> query); |
| | | |
| | | } |
| | |
| | | package org.jeecg.modules.tms.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.commons.lang.StringUtils; |
| | | import org.jeecg.common.exception.ExceptionCast; |
| | | import org.jeecg.modules.tms.entity.InStoreDetail; |
| | | import org.jeecg.modules.tms.entity.ToolsClassify; |
| | | import org.jeecg.modules.tms.mapper.InStoreDetailMapper; |
| | | import org.jeecg.modules.tms.service.IInStoreDetailService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: 入库明细 |
| | |
| | | @Service |
| | | public class InStoreDetailServiceImpl extends ServiceImpl<InStoreDetailMapper, InStoreDetail> implements IInStoreDetailService { |
| | | |
| | | @Override |
| | | public IPage<Map<String, Object>> findPageList(Integer pageNo, Integer pageSize, Map<String, String> query) { |
| | | if (pageNo == null || pageNo < 1 || pageSize == null || pageSize < 1) { |
| | | ExceptionCast.cast("参数错误"); |
| | | } |
| | | IPage<Map> pageData = new Page<Map>(pageNo, pageSize); |
| | | QueryWrapper<Map> queryWrapper = Wrappers.query(); |
| | | if (null != query) { |
| | | String classifyId = query.get("classifyId"); |
| | | if (StringUtils.isNotBlank(classifyId)) { |
| | | queryWrapper.eq("t2.id", classifyId); |
| | | } |
| | | // 排序写法 |
| | | List<OrderItem> orderItems = new ArrayList<>(); |
| | | orderItems.add(OrderItem.desc("t1.create_time")); |
| | | ((Page<Map>) pageData).setOrders(orderItems); |
| | | } |
| | | return super.getBaseMapper().findPageList(pageData,queryWrapper); |
| | | } |
| | | } |
| | |
| | | @SuppressWarnings("unused") ToolsClassify toolsClassify = new ToolsClassify(); |
| | | List<CommonGenericTree> list = new ArrayList<>(); |
| | | Map<String, CommonGenericTree> map = new HashMap<>(); |
| | | CommonGenericTree<ToolsClassify> node = new CommonGenericTree<>(); |
| | | if (CollectionUtils.isNotEmpty(toolsClassifyList)) { |
| | | CommonGenericTree<ToolsClassify> tcNode; |
| | | CommonGenericTree<ToolsClassify> childNode; |
| | |
| | | tcNode.setValue(tc.getId()); |
| | | tcNode.setDisabled(CommonConstant.STATUS_0.equals(tc.getStatus()) ? true : false); |
| | | tcNode.setRField1(tc.getClassifyId()); |
| | | tcNode.setRField2(getBaseParent(tc.getId(), 0).getClassifyId()); |
| | | //tcNode.setRField2(getBaseParent(tc.getId(), 0).getClassifyId()); |
| | | tcNode.setEntity(tc); |
| | | list.add(tcNode); |
| | | map.put(tc.getId(), tcNode); |
| | |
| | | childNode.setValue(tc.getId()); |
| | | childNode.setDisabled(CommonConstant.STATUS_0.equals(tc.getStatus()) ? true : false); |
| | | childNode.setRField1(tc.getClassifyId()); |
| | | childNode.setRField2(getBaseParent(tc.getId(), 0).getClassifyId()); |
| | | //childNode.setRField2(getBaseParent(tc.getId(), 0).getClassifyId()); |
| | | childNode.setEntity(tc); |
| | | tcNode.addChildren(childNode); |
| | | map.put(child.getId(), childNode); |