后台增加配件领料功能,以及其他问题修复
This commit is contained in:
parent
8fd45a5d37
commit
2ee86759ae
|
|
@ -67,4 +67,6 @@ public class PartApplyDetailAppVo {
|
|||
|
||||
private String proId;
|
||||
|
||||
private int num;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,4 +84,18 @@ public interface PartApplyAppMapper {
|
|||
* @return
|
||||
*/
|
||||
MachinesVo getDevInfoById(String deviceId);
|
||||
|
||||
/**
|
||||
* 修改申请记录
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int updatePartApply(PartApplyAppVo dto);
|
||||
|
||||
/**
|
||||
* 删除申请记录
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
int deleteDetails(PartApplyAppVo dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ public class PartApplyAppServiceImp {
|
|||
public ServerResponse getPartApplyDetails(PartApplyAppVo dto) {
|
||||
try{
|
||||
if(StringHelper.isEmpty(dto.getId())){
|
||||
return ServerResponse.createErroe("清先选择记录");
|
||||
return ServerResponse.createErroe("请先选择记录");
|
||||
}
|
||||
PartApplyAppVo vo=mapper.getPartApplyDetails(dto);
|
||||
List<FileUploadVo> flieList=uploadService.getFileList(dto.getId(),"t_part_apply","使用照片");
|
||||
|
|
|
|||
|
|
@ -6,6 +6,9 @@ import com.bonus.gzgqj.business.app.service.PartApplyAppServiceImp;
|
|||
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
|
||||
import com.bonus.gzgqj.business.bases.entity.PartCheckVo;
|
||||
import com.bonus.gzgqj.business.bases.service.PartApplyWebServiceImp;
|
||||
import com.bonus.gzgqj.business.plan.entity.PlanApplyBean;
|
||||
import com.bonus.gzgqj.manager.annotation.DecryptAndVerify;
|
||||
import com.bonus.gzgqj.manager.core.entity.EncryptedReq;
|
||||
import com.bonus.gzgqj.manager.webResult.ServerResponse;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
|
@ -72,9 +75,21 @@ public class PartApplyWebController {
|
|||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("addPartApply")
|
||||
public ServerResponse addPartApply(@RequestBody PartApplyAppVo dto) {
|
||||
return service.addPartApply(dto);
|
||||
@PostMapping(value = "addPartApply")
|
||||
@DecryptAndVerify(decryptedClass = PartApplyAppVo.class)
|
||||
public ServerResponse addPartApply(EncryptedReq<PartApplyAppVo> dto) {
|
||||
return service.addPartApply(dto.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改配件信息接口
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "updatePartApply")
|
||||
@DecryptAndVerify(decryptedClass = PartApplyAppVo.class)
|
||||
public ServerResponse updatePartApply(EncryptedReq<PartApplyAppVo> dto) {
|
||||
return service.updatePartApply(dto.getData());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -96,7 +111,7 @@ public class PartApplyWebController {
|
|||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("getPartApplyDetails")
|
||||
@PostMapping("getPartApplyDetails")
|
||||
public ServerResponse getPartApplyDetails(PartApplyAppVo dto) {
|
||||
return service.getPartApplyDetails(dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,6 +136,44 @@ public class PartApplyWebServiceImp {
|
|||
|
||||
}
|
||||
|
||||
public ServerResponse updatePartApply(PartApplyAppVo dto) {
|
||||
try {
|
||||
Long userId = Objects.requireNonNull(UserUtil.getLoginUser()).getUserId();
|
||||
String userName = UserUtil.getLoginUser().getUsername();
|
||||
dto.setUpdater(userId.toString());
|
||||
if (StringHelper.isEmpty(dto.getUserName())) {
|
||||
dto.setUserName(userName);
|
||||
}
|
||||
List<PartApplyDetailAppVo> list = dto.getDetailsList();
|
||||
if (list == null || list.size() < 1) {
|
||||
return ServerResponse.createErroe("请上传配件明细");
|
||||
}
|
||||
if (StringHelper.isNotEmpty(dto.getDeviceId())) {
|
||||
MachinesVo voo = mapper.getDevInfoById(dto.getDeviceId());
|
||||
dto.setDevType(voo.getType());
|
||||
}
|
||||
|
||||
final int[] applyNum = {0};
|
||||
list.forEach(vo -> {
|
||||
applyNum[0] = applyNum[0] + vo.getApplyNum();
|
||||
});
|
||||
dto.setApplyNum(applyNum[0]);
|
||||
dto.setStatus("1");
|
||||
dto.setStatusType("2");
|
||||
int num = mapper.updatePartApply(dto);
|
||||
//删除详情数据
|
||||
mapper.deleteDetails(dto);
|
||||
int num2 = mapper.insertDetails(list, dto);
|
||||
if (num2 == list.size()) {
|
||||
return ServerResponse.createSuccess("修改成功", "修改成功");
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(), e);
|
||||
}
|
||||
return ServerResponse.createErroe("配件申请修改失败");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取编码
|
||||
*
|
||||
|
|
@ -211,7 +249,7 @@ public class PartApplyWebServiceImp {
|
|||
public ServerResponse getPartApplyDetails(PartApplyAppVo dto) {
|
||||
try {
|
||||
if (StringHelper.isEmpty(dto.getId())) {
|
||||
return ServerResponse.createErroe("清先选择记录");
|
||||
return ServerResponse.createErroe("请先选择记录");
|
||||
}
|
||||
PartApplyAppVo vo = mapper.getPartApplyDetails(dto);
|
||||
List<FileUploadVo> flieList = uploadService.getFileList(dto.getId(), "t_part_apply", "使用照片");
|
||||
|
|
@ -225,4 +263,5 @@ public class PartApplyWebServiceImp {
|
|||
}
|
||||
return ServerResponse.createSuccess("查询失败", new ArrayList<PartApplyAppVo>());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,7 +155,10 @@ public class ExportController {
|
|||
try {
|
||||
List<ProNeedInfo> list = service.getPorInfoDetail2(o);
|
||||
List<ProNeedInfoExport> exports=new ArrayList<>();
|
||||
final int[] num = {1};
|
||||
list.forEach(vo->{
|
||||
vo.setXh(num[0]);
|
||||
num[0]++;
|
||||
ProNeedInfoExport voo=new ProNeedInfoExport();
|
||||
BeanUtils.copyProperties(vo, voo);
|
||||
exports.add(voo);
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@ public class ProNeedInfoExport extends PageInfo {
|
|||
/**
|
||||
* 工程名称
|
||||
*/
|
||||
@Excel(name = "工程名称", width = 10.0,height = 20.0, orderNum = "1")
|
||||
private String proName;
|
||||
/**
|
||||
* 类型
|
||||
|
|
|
|||
|
|
@ -35,6 +35,52 @@
|
|||
#{item.partType},#{item.partName},#{item.partModel},#{item.partUnit})
|
||||
</foreach>
|
||||
</insert>
|
||||
<update id="updatePartApply">
|
||||
update t_part_apply set
|
||||
<if test="userName!=null and userName!=''">
|
||||
user_name=#{userName},
|
||||
</if>
|
||||
<if test="type!=null and type!=''">
|
||||
type=#{type},
|
||||
</if>
|
||||
<if test="remark!=null and remark!=''">
|
||||
remark=#{remark},
|
||||
</if>
|
||||
<if test="status!=null and status!=''">
|
||||
status=#{status},
|
||||
</if>
|
||||
<if test="updater!=null and updater!=''">
|
||||
updater=#{updater},
|
||||
</if>
|
||||
<if test="deviceId!=null and deviceId!=''">
|
||||
dev_id=#{deviceId},
|
||||
</if>
|
||||
<if test="devCode!=null and devCode!=''">
|
||||
dev_code=#{devCode},
|
||||
</if>
|
||||
<if test="proId!=null and proId!=''">
|
||||
pro_id=#{proId},
|
||||
</if>
|
||||
<if test="proName!=null and proName!=''">
|
||||
pro_name=#{proName},
|
||||
</if>
|
||||
<if test="applyNum!=null and applyNum!=''">
|
||||
apply_num=#{applyNum},
|
||||
</if>
|
||||
<if test="statusType!=null and statusType!=''">
|
||||
status_type=#{statusType},
|
||||
</if>
|
||||
<if test="devType!=null and devType!=''">
|
||||
dev_type=#{devType},
|
||||
</if>
|
||||
update_time=NOW()
|
||||
where id=#{id}
|
||||
</update>
|
||||
<delete id="deleteDetails">
|
||||
DELETE
|
||||
FROM t_part_apply_details
|
||||
WHERE apply_id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="getDevList" resultType="com.bonus.gzgqj.business.app.entity.MachinesVo">
|
||||
SELECT
|
||||
|
|
@ -98,6 +144,13 @@
|
|||
pt.name like concat('%',#{keyWord},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="name!=null and name!=''">
|
||||
and (
|
||||
pt2.name like concat('%',#{name},'%') or
|
||||
pt1.name like concat('%',#{name},'%') or
|
||||
pt.name like concat('%',#{name},'%')
|
||||
)
|
||||
</if>
|
||||
</select>
|
||||
<select id="getSqList" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
|
|
@ -138,6 +191,7 @@
|
|||
and STR_TO_DATE(tpa.create_time, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND STR_TO_DATE(#{endDay},'%Y-%m-%d')
|
||||
</if>
|
||||
</where>
|
||||
order by tpa.create_time desc
|
||||
</select>
|
||||
<select id="getPartApplyDetails" resultType="com.bonus.gzgqj.business.app.entity.PartApplyAppVo">
|
||||
select tpa.id,tpa.code,tpa.creator,tpa.user_name userName,
|
||||
|
|
@ -161,7 +215,7 @@
|
|||
<select id="getDetailsList" resultType="com.bonus.gzgqj.business.app.entity.PartApplyDetailAppVo">
|
||||
select ppd.id,ppd.apply_id applyId, ppd.part_id partId, ppd.apply_num applyNum,
|
||||
ppd.part_type partType, ppd.part_name partName, ppd.part_model partModel,ppd.part_unit partUnit,
|
||||
pt.price ,(ppd.apply_num*pt.price ) money
|
||||
pt.price ,(ppd.apply_num*pt.price ) money,pt.num
|
||||
from t_part_apply_details ppd
|
||||
LEFT JOIN pa_type pt on pt.id=ppd.part_id
|
||||
where ppd.apply_id=#{id}
|
||||
|
|
|
|||
Loading…
Reference in New Issue