Merge branch 'dev-cq-bug' of http://192.168.0.56:3000/bonus/devicesmgt into dev-cq-bug
This commit is contained in:
commit
8048fc5ec9
|
|
@ -4,10 +4,9 @@ import cn.hutool.core.collection.CollUtil;
|
|||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.PhoneUtil;
|
||||
import com.bonus.sgzb.app.domain.*;
|
||||
import com.bonus.sgzb.app.service.LeaseApplyDetailsService;
|
||||
import com.bonus.sgzb.app.service.LeaseApplyInfoService;
|
||||
import com.bonus.sgzb.app.service.LeaseUserBookService;
|
||||
import com.bonus.sgzb.app.service.TmTaskService;
|
||||
import com.bonus.sgzb.app.service.*;
|
||||
import com.bonus.sgzb.base.api.domain.MaType;
|
||||
import com.bonus.sgzb.base.service.ITypeService;
|
||||
import com.bonus.sgzb.common.core.utils.ListPagingUtil;
|
||||
import com.bonus.sgzb.common.core.utils.ServletUtils;
|
||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||
|
|
@ -25,6 +24,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
|
@ -59,6 +59,9 @@ public class TmTaskController extends BaseController {
|
|||
@Autowired
|
||||
private LeaseUserBookService leaseUserBookService;
|
||||
|
||||
@Resource
|
||||
private ITypeService iTypeService;
|
||||
|
||||
private final static String STRING_ADMIN = "admin";
|
||||
|
||||
/**
|
||||
|
|
@ -245,6 +248,15 @@ public class TmTaskController extends BaseController {
|
|||
}
|
||||
}
|
||||
}
|
||||
//修改库存
|
||||
List<LeaseApplyDetails> leaseApplyDetailsList = task.getLeaseApplyDetails();
|
||||
MaType maType = new MaType();
|
||||
for (LeaseApplyDetails leaseApplyDetails : leaseApplyDetailsList) {
|
||||
maType.setTypeId(Long.valueOf(leaseApplyDetails.getTypeId()));
|
||||
maType.setNum(BigDecimal.valueOf(leaseApplyDetails.getNum()-leaseApplyDetails.getPreNum()));
|
||||
iTypeService.updateMaType(maType);
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(taskId)) {
|
||||
return AjaxResult.error("任务编号为空,创建失败");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,4 +101,6 @@ public interface LeaseOutDetailsMapper {
|
|||
int updateMaTypeStockNumCt(TmTask record);
|
||||
|
||||
int getmaChineByCt(LeaseOutDetails record);
|
||||
|
||||
void updateMaTypeNum(LeaseApplyDetails leaseApplyDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -216,6 +216,8 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
|
|||
MachinePart machinePart = leaseOutDetailsMapper.getMachineParts(typeId);
|
||||
machinePart.setPartNum((int) (typeId.getPartNum() * record.getOutNum()));
|
||||
typeId.setNum(machinePart.getNum() - machinePart.getPartNum());
|
||||
|
||||
|
||||
res = leaseOutDetailsMapper.updateMaTypeStockNumCt(typeId);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -69,5 +69,4 @@ public interface ITypeService {
|
|||
|
||||
List<MaType> getEquipmentType(Long typeId, String typeName);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -307,6 +307,14 @@
|
|||
WHERE
|
||||
type_id = #{typeId}
|
||||
</update>
|
||||
<update id="updateMaTypeNum">
|
||||
UPDATE
|
||||
ma_type
|
||||
SET
|
||||
num = #{num} ,update_time = NOW()
|
||||
WHERE
|
||||
type_id = #{typeId}
|
||||
</update>
|
||||
|
||||
<insert id="insertAgreementInfo">
|
||||
insert into tm_task_agreement
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</sql>
|
||||
|
||||
<select id="selectPurchaseMacodeInfoList" parameterType="com.bonus.sgzb.material.domain.PurchaseMacodeInfo" resultMap="PurchaseMacodeInfoResult">
|
||||
select distinct pcd.task_id, pcd.type_id, pmi.qr_code, pmi.fix_code, pmi.code_type, pmi.status,
|
||||
select pcd.task_id, pcd.type_id, pmi.qr_code, pmi.fix_code, pmi.code_type, pmi.status,
|
||||
pmi.remark, pmi.company_id, mt.type_name specificationType, pt.arrival_time arrivalTime,
|
||||
mt1.type_name typeName, pcd.check_num checkNum, pcd.purchase_num purchaseNum ,
|
||||
IFNULL(pcd.bind_num,0) bindNum, mt.code typeCode,mt.model_code specsCode,pt.purchase_time purchaseTime
|
||||
|
|
|
|||
Loading…
Reference in New Issue