change - PDA补打条码、解绑SN成品码接口

master
yinq 1 year ago
parent 208e2b2e05
commit 4ce057c4fb

@ -6,6 +6,7 @@ import com.aucma.api.service.IPdaBindingService;
import com.aucma.base.domain.BaseProcessStation;
import com.aucma.base.service.IBaseProcessStationService;
import com.aucma.common.core.domain.AjaxResult;
import com.aucma.common.utils.SecurityUtils;
import com.aucma.common.utils.StringUtils;
import com.aucma.report.domain.ReportQualityInspection;
import com.aucma.report.service.IMaterialCompletionService;
@ -105,8 +106,8 @@ public class PdaApiController {
inspection.setIsFlag(1L);
}
//检测人
inspection.setInspectorCode(checkInfo.getUserName());
// inspection.setInspectorCode(SecurityUtils.getUsername());
// inspection.setInspectorCode(checkInfo.getUserName());
inspection.setInspectorCode(SecurityUtils.getUsername());
inspection.setInspectorTime(new Date());
inspection.setStationCode(checkInfo.getStationCode());
inspection.setGroupCode(checkInfo.getTeamCode());
@ -175,4 +176,33 @@ public class PdaApiController {
return success(qualityService.pdaQueryQuantityNumber(stationCode));
}
/**
* PDA
*
* @param barCode
* @return
*/
@PostMapping("/rebarCode")
public AjaxResult rebarCode(String barCode) {
String result = service.rebarCode(barCode);
if (StringUtils.isEmpty(result)){
return error("条码信息输入错误!");
}
return success(result);
}
/**
* PDA
*
* @param barCode
* @return
*/
@PostMapping("/unbindBarCode")
public AjaxResult unbindBarCode(String barCode) {
String result = service.unbindBarCode(barCode);
if (StringUtils.isEmpty(result)){
return error("条码信息输入错误!");
}
return success(result);
}
}

@ -7,6 +7,7 @@ import com.aucma.report.domain.ReportQualityInspection;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.HashMap;
import java.util.List;
/**
@ -30,4 +31,20 @@ public interface PdaBindingMapper {
List<ReportQualityInspection> findCheckInfoByCode(String code);
List<ReportQualityInspection> checkSelectRepairInfo(String code);
/**
*
* @param code
* @return
*/
@DataSource(value = DataSourceType.SLAVE)
List<HashMap<String, String>> selectPrintBarcode(String code);
/**
* PDA
* @param barCode
* @return
*/
@DataSource(value = DataSourceType.SLAVE)
int unbindBarCode(String barCode);
}

@ -23,4 +23,21 @@ public interface IPdaBindingService {
List<ReportQualityInspection> findCheckInfoByCode(String code);
List<ReportQualityInspection> checkSelectRepairInfo(String code);
/**
* PDA
*
* @param barCode
* @return
*/
public String rebarCode(String barCode);
/**
* PDA
*
* @param barCode
* @return
*/
public String unbindBarCode(String barCode);
}

@ -3,10 +3,12 @@ package com.aucma.api.service.impl;
import com.aucma.api.domain.dto.RepairSubmitInfoDto;
import com.aucma.api.mapper.PdaBindingMapper;
import com.aucma.api.service.IPdaBindingService;
import com.aucma.common.utils.StringUtils;
import com.aucma.report.domain.ReportQualityInspection;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
/**
@ -53,4 +55,43 @@ public class PdaServiceImpl implements IPdaBindingService {
public List<ReportQualityInspection> checkSelectRepairInfo(String code) {
return mapper.checkSelectRepairInfo(code);
}
/**
* PDA
* @param barCode
* @return
*/
@Override
public String rebarCode(String barCode) {
String result = null;
if (StringUtils.isEmpty(barCode)){
return null;
}
List<HashMap<String, String>> barcodeList = mapper.selectPrintBarcode(barCode);
if (barcodeList.size() > 0){
// 维护条码补打记录表
result = "请到条码打印机旁进行补打条码!";
}
return result;
}
/**
* PDA
* @param barCode
* @return
*/
@Override
public String unbindBarCode(String barCode) {
String result = null;
if (StringUtils.isEmpty(barCode)){
return null;
}
List<HashMap<String, String>> barcodeList = mapper.selectPrintBarcode(barCode);
if (barcodeList.size() > 0){
mapper.unbindBarCode(barCode);
result = "解绑条码成功!";
}
return result;
}
}

@ -19,7 +19,6 @@
where BOX_CODE = #{boxCode}
</update>
<select id="countQualityRecordByCode" resultType="int">
select count(OBJ_ID)
from REPORT_QUALITY_INSPECTION
@ -62,4 +61,16 @@
and TREATMENT_MEASURE=1
</select>
<select id="selectPrintBarcode" resultType="java.util.HashMap">
SELECT ORDER_CODE, MATERIAL_CODE, MATERIAL_BARCODE
FROM PRINT_BARCODE
WHERE MATERIAL_BARCODE = #{boxCode}
</select>
<update id="unbindBarCode">
UPDATE CODE_BINDING
SET PRODUCT_CODE = NULL, RECORD_TIME2 = NULL
WHERE BOX_CODE = #{boxCode}
</update>
</mapper>

@ -127,6 +127,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
.antMatchers(HttpMethod.GET, "/base/teamMembers/**").permitAll()
.antMatchers(HttpMethod.POST, "/webApi/electricalInspection").permitAll()
.antMatchers(HttpMethod.POST, "/api/**").permitAll()
.antMatchers(HttpMethod.POST, "/report/**").permitAll()
.antMatchers(HttpMethod.POST, "/**/**/**").permitAll()
.antMatchers(HttpMethod.GET, "/**/**/**").permitAll()
// 除上面外的所有请求全部需要鉴权认证

Loading…
Cancel
Save