|
@@ -51,13 +51,12 @@ public class ProcurementPlanInfoServiceImpl extends ServiceImpl<ProcurementPlanI
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
public String editProcurementPlan(ProcurementPlanInfo procurementPlanInfo) {
|
|
public String editProcurementPlan(ProcurementPlanInfo procurementPlanInfo) {
|
|
- //查询采购计划信息
|
|
|
|
- ProcurementPlanInfo procurementPlanInfos = this.selectById(procurementPlanInfo.getId());
|
|
|
|
- if (procurementPlanInfos != null) {
|
|
|
|
- //编辑采购计划信息
|
|
|
|
- this.updateById(procurementPlanInfos);
|
|
|
|
|
|
+ boolean one = this.updateById(procurementPlanInfo);
|
|
|
|
+ if (one) {
|
|
|
|
+ return "OK";
|
|
|
|
+ } else {
|
|
|
|
+ return "NG";
|
|
}
|
|
}
|
|
- return procurementPlanInfos.getId();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -126,29 +125,47 @@ public class ProcurementPlanInfoServiceImpl extends ServiceImpl<ProcurementPlanI
|
|
/**
|
|
/**
|
|
* 更改状态
|
|
* 更改状态
|
|
* @param id
|
|
* @param id
|
|
|
|
+ * @param flag 0 修改状态 1修改基差 2 修改单价
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
@Override
|
|
@Override
|
|
- public String editStatus(String id){
|
|
|
|
|
|
+ public String editStatus(String id,String basisPrice,String unitPrice,Integer flag){
|
|
//查询采购订单信息
|
|
//查询采购订单信息
|
|
ProcurementPlanInfo procurementPlanInfo = this.selectById(id);
|
|
ProcurementPlanInfo procurementPlanInfo = this.selectById(id);
|
|
- //更改状态
|
|
|
|
if (procurementPlanInfo != null ){
|
|
if (procurementPlanInfo != null ){
|
|
- if (StatusEnum.PURCHASE_HIDE.getFlag().equals(procurementPlanInfo.getStatusFlag())) {
|
|
|
|
- procurementPlanInfo.setStatusFlag(StatusEnum.PURCHASE_SHOW.getFlag());
|
|
|
|
- procurementPlanInfo.setStatus(StatusEnum.PURCHASE_SHOW.getName());
|
|
|
|
- } else {
|
|
|
|
- procurementPlanInfo.setStatusFlag(StatusEnum.PURCHASE_HIDE.getFlag());
|
|
|
|
- procurementPlanInfo.setStatus(StatusEnum.PURCHASE_HIDE.getName());
|
|
|
|
|
|
+ //更改状态
|
|
|
|
+ if(flag == 0) {
|
|
|
|
+ procurementPlanInfo.setUnitPrice(unitPrice);
|
|
|
|
+ //更改采购计划信息
|
|
|
|
+ this.updateById(procurementPlanInfo);
|
|
|
|
+ if (StatusEnum.PURCHASE_HIDE.getFlag().equals(procurementPlanInfo.getStatusFlag())) {
|
|
|
|
+ procurementPlanInfo.setStatusFlag(StatusEnum.PURCHASE_SHOW.getFlag());
|
|
|
|
+ procurementPlanInfo.setStatus(StatusEnum.PURCHASE_SHOW.getName());
|
|
|
|
+ } else {
|
|
|
|
+ procurementPlanInfo.setStatusFlag(StatusEnum.PURCHASE_HIDE.getFlag());
|
|
|
|
+ procurementPlanInfo.setStatus(StatusEnum.PURCHASE_HIDE.getName());
|
|
|
|
+ }
|
|
|
|
+ //更改采购计划信息
|
|
|
|
+ this.updateById(procurementPlanInfo);
|
|
|
|
+ // 插入操作历史
|
|
|
|
+ String staffName = this.billOperateHisService.getStaffAndName();
|
|
|
|
+ // 插入操作历史
|
|
|
|
+ this.billOperateHisService.saveBillOperateHis(procurementPlanInfo.getId(), NumberConstant.CONSTANT_PURCHASE, staffName, null,
|
|
|
|
+ procurementPlanInfo.getStatus(), null, "");
|
|
|
|
+ return "OK";
|
|
|
|
+ }
|
|
|
|
+ //更改基差
|
|
|
|
+ else if(flag==1){
|
|
|
|
+ procurementPlanInfo.setBasisPrice(basisPrice);
|
|
|
|
+ //更改采购计划信息
|
|
|
|
+ this.updateById(procurementPlanInfo);
|
|
|
|
+ }
|
|
|
|
+ //更改单价
|
|
|
|
+ else {
|
|
|
|
+ procurementPlanInfo.setUnitPrice(unitPrice);
|
|
|
|
+ //更改采购计划信息
|
|
|
|
+ this.updateById(procurementPlanInfo);
|
|
}
|
|
}
|
|
- //更改运输任务信息
|
|
|
|
- this.updateById(procurementPlanInfo);
|
|
|
|
- // 插入操作历史
|
|
|
|
- String staffName = this.billOperateHisService.getStaffAndName();
|
|
|
|
- // 插入操作历史
|
|
|
|
- this.billOperateHisService.saveBillOperateHis(procurementPlanInfo.getId(), NumberConstant.CONSTANT_PURCHASE, staffName, null,
|
|
|
|
- procurementPlanInfo.getStatus(), null, "");
|
|
|
|
- return "OK";
|
|
|
|
}
|
|
}
|
|
return "NG";
|
|
return "NG";
|
|
|
|
|