feat 无订单无批次入库-收货接口
This commit is contained in:
parent
c58e1d9f7f
commit
c632d22b89
@ -0,0 +1,59 @@
|
|||||||
|
package com.cim.idm.controller;
|
||||||
|
|
||||||
|
import com.cim.idm.framework.IDMFrameServiceProxy;
|
||||||
|
import com.cim.idm.framework.data.EventInfo;
|
||||||
|
import com.cim.idm.response.BaseResponse;
|
||||||
|
import com.cim.idm.response.RespGenerator;
|
||||||
|
import com.cim.idm.utils.EventInfoUtil;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.sql.Timestamp;
|
||||||
|
import java.text.ParseException;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.ZoneOffset;
|
||||||
|
import java.time.ZonedDateTime;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Api("无订单无批次缓存仓")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/stockIn")
|
||||||
|
@EnableAutoConfiguration
|
||||||
|
public class CacheWareController {
|
||||||
|
|
||||||
|
@RequestMapping(value = "/checkNChargeNOrder", method = RequestMethod.POST)
|
||||||
|
public BaseResponse<Map<String, Object>> checkNChargeNOrder(@RequestBody Map<String,Object> params) throws ParseException {
|
||||||
|
|
||||||
|
String sitename = (String)params.get("SITENAME");
|
||||||
|
String userid = (String)params.get("USERID");
|
||||||
|
String materialspecname = (String)params.get("MATERIALSPECNAME");
|
||||||
|
String makedatet = (String) params.get("MAKEDATE");
|
||||||
|
// @TODO 原代码异常:Timestamp makedate = Timestamp.valueOf(makedatet);
|
||||||
|
Timestamp makedate = Timestamp.from(
|
||||||
|
LocalDateTime.parse(makedatet, DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSZ"))
|
||||||
|
.atZone(ZoneOffset.UTC).toInstant());
|
||||||
|
String is_sure = (String)params.get("IS_SURE");
|
||||||
|
|
||||||
|
Map<String, Object> bindMap = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
bindMap.put("SITENAME", sitename);
|
||||||
|
bindMap.put("MATERIALSPECNAME", materialspecname);
|
||||||
|
bindMap.put("MAKEDATE", makedate);
|
||||||
|
bindMap.put("IS_SURE", is_sure);
|
||||||
|
|
||||||
|
String sql = "UPDATE MATERIALCACHE E SET E.IS_SURE = :IS_SURE WHERE E.MATERIALSPECNAME = :MATERIALSPECNAME AND SITENAME = :SITENAME AND MAKEDATE = :MAKEDATE";
|
||||||
|
IDMFrameServiceProxy.getSqlTemplate().update(sql, bindMap);
|
||||||
|
|
||||||
|
EventInfo eventInfo = new EventInfoUtil().makeEventInfo("checkNChargeNOrder", userid, "checkNChargeNOrder");
|
||||||
|
|
||||||
|
BaseResponse returnOK = RespGenerator.returnOK(params);
|
||||||
|
return returnOK;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user