Browse Source

20241112

java8
qiezi 2 years ago
parent
commit
253351bf40
  1. 18
      src/main/java/com/xujie/sys/modules/part/controller/PartInformationController.java
  2. 4
      src/main/java/com/xujie/sys/modules/part/mapper/PartInformationMapper.java
  3. 4
      src/main/java/com/xujie/sys/modules/part/service/PartInformationService.java
  4. 12
      src/main/java/com/xujie/sys/modules/part/service/impl/PartInformationServiceImpl.java
  5. 3
      src/main/java/com/xujie/sys/modules/part/vo/PartInformationVo.java
  6. 62
      src/main/resources/mapper/part/PartInformationMapper.xml

18
src/main/java/com/xujie/sys/modules/part/controller/PartInformationController.java

@ -1,5 +1,6 @@
package com.xujie.sys.modules.part.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xujie.sys.common.utils.PageUtils;
import com.xujie.sys.common.utils.R;
import com.xujie.sys.modules.base.entity.Chooselist;
@ -55,6 +56,23 @@ public class PartInformationController {
return R.ok().put("page", page);
}
@PostMapping
@ResponseBody
public R handleQueryPart(@RequestBody PartInformationVo part){
List<PartInformationVo> list = partInformationService.handleQueryPart(part);
return R.ok().put("rows", list);
}
@PostMapping("/{no}/{size}")
@ResponseBody
public R handleQueryPartByPage(@RequestBody PartInformationVo part,
@PathVariable int no,
@PathVariable int size){
IPage<PartInformationVo> page = partInformationService.handleQueryPartByPage(part, no, size);
return R.ok().put("rows",page.getRecords()).put("total",page.getTotal());
}
/**
* @description: 材料信息新增
* @author: fengyuan_yang

4
src/main/java/com/xujie/sys/modules/part/mapper/PartInformationMapper.java

@ -143,4 +143,8 @@ public interface PartInformationMapper extends BaseMapper<PartInformationEntity>
void savePartDefaultLocation(List<LocationInformationVo> ifsDefaultLocations);
String getNextPartNo2(PartInformationVo data);
IPage<PartInformationVo> handleQueryPartByPage(@Param("page") Page<PartInformationVo> page,@Param("params") PartInformationVo part);
List<PartInformationVo> handleQueryPart(PartInformationVo part);
}

4
src/main/java/com/xujie/sys/modules/part/service/PartInformationService.java

@ -1,5 +1,6 @@
package com.xujie.sys.modules.part.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xujie.sys.common.utils.PageUtils;
import com.xujie.sys.modules.part.entity.*;
@ -81,4 +82,7 @@ public interface PartInformationService extends IService<PartInformationEntity>
void copyPart(PartInformationVo inData);
List<PartInformationVo> handleQueryPart(PartInformationVo part);
IPage<PartInformationVo> handleQueryPartByPage(PartInformationVo part, int no, int size);
}

12
src/main/java/com/xujie/sys/modules/part/service/impl/PartInformationServiceImpl.java

@ -696,4 +696,16 @@ public class PartInformationServiceImpl extends ServiceImpl<PartInformationMappe
return false;
}
}
@Override
public List<PartInformationVo> handleQueryPart(PartInformationVo part) {
return baseMapper.handleQueryPart(part);
}
@Override
public IPage<PartInformationVo> handleQueryPartByPage(PartInformationVo part, int no, int size) {
Page<PartInformationVo> page = new Page<>(no, size);
return baseMapper.handleQueryPartByPage(page, part);
}
}

3
src/main/java/com/xujie/sys/modules/part/vo/PartInformationVo.java

@ -87,6 +87,8 @@ public class PartInformationVo extends PartInformationEntity {
* 模板名称
**/
private String codeDesc;
private Integer buId;
/**
* 代理商集合
*/
@ -120,4 +122,5 @@ public class PartInformationVo extends PartInformationEntity {
private String activeDesc;
private String partType2Desc;
}

62
src/main/resources/mapper/part/PartInformationMapper.xml

@ -771,4 +771,66 @@
<select id="getNextPartNo2" resultType="string" parameterType="com.xujie.sys.modules.part.vo.PartInformationVo">
select dbo.get_next_part_code(#{site}, #{buNo}, #{queryType})
</select>
<select id="handleQueryPart" resultType="com.xujie.sys.modules.part.vo.PartInformationVo">
select p.id,
p.site,
part_no,
part_desc,
umid2 as umId2,
dbo.qc_get_um_name(p.site, umid2) as umName,
sourceBu as buNo,
dbo.get_bu_desc(p.site, sourceBu) as buDesc,
part_type2,
case
when part_type2 = 'Manufactured' then '成品'
when part_type2 = 'Manufactured Recipe' then '半成品'
when part_type2 = 'Purchased (raw)' then '原材料' end as partType2Desc
from part p
left join BU b on p.sourceBu = b.bu_no and p.site = b.site
where
p.site in (select site from eam_access_site where username = #{userName})
and (p.site + '-' + sourceBu) in (select * from dbo.query_bu(#{userName}))
and p.active = 'Y'
<if test="buId != null">
and b.id = #{buId}
</if>
<if test = "partNo != null and partNo != ''">
AND part_no like #{partNo}
</if>
<if test = "partDesc != null and partDesc != ''">
AND part_desc like #{partDesc}
</if>
</select>
<select id="handleQueryPartByPage" resultType="com.xujie.sys.modules.part.vo.PartInformationVo">
select p.id,
p.site,
part_no,
part_desc,
umid2 as umId2,
dbo.qc_get_um_name(p.site, umid2) as umName,
sourceBu as buNo,
dbo.get_bu_desc(p.site, sourceBu) as buDesc,
part_type2,
case
when part_type2 = 'Manufactured' then '成品'
when part_type2 = 'Manufactured Recipe' then '半成品'
when part_type2 = 'Purchased (raw)' then '原材料' end as partType2Desc
from part p
left join BU b on p.sourceBu = b.bu_no and p.site = b.site
where
p.site in (select site from eam_access_site where username = #{params.userName})
and (p.site + '-' + sourceBu) in (select * from dbo.query_bu(#{params.userName}))
and p.active = 'Y'
<if test="params.buId != null">
and b.id = #{params.buId}
</if>
<if test = "params.partNo != null and params.partNo != ''">
AND part_no like #{params.partNo}
</if>
<if test = "params.partDesc != null and params.partDesc != ''">
AND part_desc like #{params.partDesc}
</if>
</select>
</mapper>
Loading…
Cancel
Save