yinq 1 year ago
commit 76d3e6baa6

@ -0,0 +1,36 @@
package com.aucma.api.controller;
import com.aucma.api.service.IPdaBindingService;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Optional;
import static com.aucma.common.core.domain.AjaxResult.error;
import static com.aucma.common.core.domain.AjaxResult.success;
/**
* @author wanghao
* @date 2023/11/14 9:28
*/
@RestController("/api")
public class PdaBindingController {
@Autowired
private IPdaBindingService service;
//壳胆绑定-提交
@PostMapping("/boxBanding")
public AjaxResult binding(String boxCode,String innerCode,String loginName){
String boxName = service.selectBoxNameByCode(boxCode);
if (StringUtils.isNotNull(boxName)){
service.insertBindingInfo(boxCode,boxName,innerCode);
return success( ) ;
}
return error("箱壳条码扫描");
}
//条码绑定
}

@ -0,0 +1,17 @@
package com.aucma.api.mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
/**
* @author wanghao
* @date 2023/11/14 10:16
*/
@Repository
public interface PdaBindingMapper {
String selectBoxNameByCode(String boxCode);
int insertBindingInfo(@Param("boxCode") String boxCode,
@Param("boxName") String boxName,
@Param("innerCode")String innerCode);
}

@ -0,0 +1,11 @@
package com.aucma.api.service;
/**
* @author wanghao
* @date 2023/11/14 9:56
*/
public interface IPdaBindingService {
String selectBoxNameByCode(String boxCode);
int insertBindingInfo(String boxCode, String boxName, String innerCode);
}

@ -0,0 +1,28 @@
package com.aucma.api.service.impl;
import com.aucma.api.mapper.PdaBindingMapper;
import com.aucma.api.service.IPdaBindingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author wanghao
* @date 2023/11/14 9:56
*/
@Service
public class PdaServiceImpl implements IPdaBindingService {
@Autowired
private PdaBindingMapper mapper;
@Override
public String selectBoxNameByCode(String boxCode) {
return mapper.selectBoxNameByCode(boxCode);
}
@Override
public int insertBindingInfo(String boxCode, String boxName, String innerCode) {
return mapper.insertBindingInfo(boxCode,boxName,innerCode);
}
}

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.aucma.api.mapper.PdaBindingMapper">
<select id="selectBoxNameByCode" resultType="string">
SELECT MATERIAL_NAME
FROM AUCMA_MES.BASE_BOMINFO
WHERE MATERIAL_CODE = #{boxCode}
</select>
<insert id="insertBindingInfo">
INSERT INTO AUCMA_SCADA.CODE_BINDING (OBJ_ID, BOX_CODE, BOX_NAME, PRODUCT_CODE, BINDING_RESULT, RECORD_TIME1,
RECORD_TIME2)
VALUES (SEQ_CODE_BINDING.nextval, #{boxCode}, #{boxName}, #{innerCode}, '成功', SYSDATE, SYSDATE)
</insert>
</mapper>
Loading…
Cancel
Save