库存日志
This commit is contained in:
parent
c03995f514
commit
e0a9901c59
|
|
@ -350,4 +350,7 @@ public class BackApplyInfo extends BaseEntity {
|
|||
private String time;
|
||||
|
||||
private int viewWeb;
|
||||
|
||||
/** 操作后库存 */
|
||||
private int postStoreNum;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -309,20 +309,20 @@ public class LogAspect
|
|||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
// 退料接收-完成退料
|
||||
// if (joinPoint.getArgs()[0] instanceof BackApplyInfo) {
|
||||
// BackApplyInfo bai = (BackApplyInfo)joinPoint.getArgs()[0];
|
||||
// BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
// bmStorageLog.setTaskId(String.valueOf(bai.getTaskId()));
|
||||
// bmStorageLog.setTypeId(Integer.parseInt(bai.getTypeId()));
|
||||
// bmStorageLog.setTypeName(bai.getMaCode());
|
||||
// bmStorageLog.setPreStoreNum(Integer.parseInt(bai.getNum()));
|
||||
// bmStorageLog.setBackNum(bai.getBackNum());
|
||||
// bmStorageLog.setPassNum(bai.getPassNum());
|
||||
// bmStorageLog.setMaintenanceNum(bai.getMaintenanceNum());
|
||||
// bmStorageLog.setScrapNum(bai.getScrapNum());
|
||||
// bmStorageLog.setPostStoreNum(bai.getPostStoreNum());
|
||||
// bmStorageLogList.add(bmStorageLog);
|
||||
// }
|
||||
if (joinPoint.getArgs()[0] instanceof BackApplyInfo) {
|
||||
BackApplyInfo bai = (BackApplyInfo)joinPoint.getArgs()[0];
|
||||
BmStorageLog bmStorageLog = new BmStorageLog();
|
||||
bmStorageLog.setTaskId(String.valueOf(bai.getTaskId()));
|
||||
bmStorageLog.setTypeId(Integer.parseInt(bai.getTypeId()));
|
||||
bmStorageLog.setTypeName(bai.getMaCode());
|
||||
bmStorageLog.setPreStoreNum(Integer.parseInt(bai.getNum()));
|
||||
bmStorageLog.setBackNum(bai.getBackNum());
|
||||
bmStorageLog.setPassNum(bai.getPassNum());
|
||||
bmStorageLog.setMaintenanceNum(bai.getMaintenanceNum());
|
||||
bmStorageLog.setScrapNum(bai.getScrapNum());
|
||||
bmStorageLog.setPostStoreNum(bai.getPostStoreNum());
|
||||
bmStorageLogList.add(bmStorageLog);
|
||||
}
|
||||
// 二级库出入库, 不影响ma_type库存变化,暂时不加库存监控日志
|
||||
// if (joinPoint.getArgs()[0] instanceof TeamLeaseInfo) {
|
||||
// TeamLeaseInfo tli = (TeamLeaseInfo)joinPoint.getArgs()[0];
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ public interface BackReceiveMapper {
|
|||
*/
|
||||
int updateMaStatus(@Param("maId") int maId,@Param("maStatus") String maStatus);
|
||||
|
||||
|
||||
int getmaChineByCt(BackApplyInfo record);
|
||||
|
||||
/**
|
||||
* getHgList
|
||||
* @param record
|
||||
|
|
|
|||
|
|
@ -146,6 +146,17 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
int res;
|
||||
// try {
|
||||
int taskId = record.getTaskId();
|
||||
int passNum = 0;
|
||||
int maintenanceNum = 0;
|
||||
int scrapNum = 0;
|
||||
List<BackApplyInfo> allList1 = backReceiveMapper.getAllList(record);
|
||||
if (allList1 != null && allList1.size() > 0) {
|
||||
BackApplyInfo b = allList1.get(0);
|
||||
record.setTypeId(b.getTypeId());
|
||||
int num = backReceiveMapper.getmaChineByCt(record);
|
||||
record.setNum(String.valueOf(num));
|
||||
}
|
||||
|
||||
//先判断是否已经完成退料了
|
||||
int taskStatus = selectTaskStatus(taskId);
|
||||
if (taskStatus == 0) {
|
||||
|
|
@ -181,7 +192,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if (res == 0) {
|
||||
throw new RuntimeException("ma_machines");
|
||||
}
|
||||
|
||||
for (BackApplyInfo bi : hgList) {
|
||||
passNum += bi.getBackNum();
|
||||
}
|
||||
}
|
||||
//维修的创建维修任务,插入任务协议表
|
||||
List<BackApplyInfo> wxList = backReceiveMapper.getWxList(record);
|
||||
|
|
@ -192,6 +205,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
res = insertTta(newTaskId, wxList);
|
||||
//插入维修记录表repair_apply_details
|
||||
res = insertRad(newTaskId, wxList);
|
||||
for (BackApplyInfo bi : wxList) {
|
||||
maintenanceNum += bi.getBackNum();
|
||||
}
|
||||
}
|
||||
//待报废的创建报废任务,插入任务协议表
|
||||
|
||||
|
|
@ -203,6 +219,9 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
res = insertTta(newTaskId, bfList);
|
||||
//插入维修记录表scrap_apply_details
|
||||
res = insertSad(newTaskId, bfList);
|
||||
for (BackApplyInfo bi : bfList) {
|
||||
scrapNum += bi.getBackNum();
|
||||
}
|
||||
}
|
||||
|
||||
List<BackApplyInfo> allList = backReceiveMapper.getAllList(record);
|
||||
|
|
@ -211,7 +230,18 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if (res == 0) {
|
||||
throw new RuntimeException("该机具未被领料使用");
|
||||
}
|
||||
BackApplyInfo b = allList.get(0);
|
||||
record.setTypeId(b.getTypeId());
|
||||
int postStoreNum = backReceiveMapper.getmaChineByCt(record);
|
||||
record.setPostStoreNum(postStoreNum);
|
||||
}
|
||||
|
||||
//库存日志
|
||||
record.setBackNum(passNum+maintenanceNum+scrapNum);
|
||||
record.setPassNum(passNum);
|
||||
record.setMaintenanceNum(maintenanceNum);
|
||||
record.setScrapNum(scrapNum);
|
||||
|
||||
// } catch (Exception e) {
|
||||
// throw new RuntimeException(e.getMessage());
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -695,9 +695,14 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getmaChineByCt" resultType="java.lang.Integer">
|
||||
select num from ma_type WHERE type_id = #{typeId}
|
||||
</select>
|
||||
|
||||
<select id="selectTaskNumByMonthWx" resultType="java.lang.Integer">
|
||||
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{taskType}
|
||||
</select>
|
||||
|
||||
<select id="getHgList" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||
SELECT
|
||||
tta.agreement_id as agreementId,
|
||||
|
|
|
|||
Loading…
Reference in New Issue