完善注解

This commit is contained in:
liuchengqian 2022-02-28 17:02:31 +08:00
parent c82714f206
commit 0a16db2bd1
3 changed files with 12 additions and 24 deletions

View File

@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(basePackages = {"com.xkrs.model.entity"})
//@ComponentScan(basePackages = {"com.xkrs.model.entity", "com.xkrs.controller", "com.xkrs.service"})
public class WordAndExcelApplication {
public static void main(String[] args) {

View File

@ -9,6 +9,7 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
@ -16,6 +17,7 @@ import java.util.Locale;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
@RestController
public class QcInspectionSpecController {
@Resource

View File

@ -3,7 +3,6 @@ package com.xkrs.service.impl;
import com.xkrs.dao.QcInspectionItemDictDao;
import com.xkrs.dao.QcInspectionSpecDao;
import com.xkrs.encapsulation.PromptMessageEnum;
import com.xkrs.model.entity.QcInspectionItemDict;
import com.xkrs.model.entity.QcInspectionSpec;
import com.xkrs.model.qo.QcInspectionSpecQo;
import com.xkrs.service.QcInspectionSpecService;
@ -31,33 +30,20 @@ public class QcInspectionSpecServiceImpl implements QcInspectionSpecService {
*/
@Override
public String insertSpec(QcInspectionSpecQo inspectionSpecQo) {
String partNo = inspectionSpecQo.getPartNo();
String inspectionItemCode = inspectionSpecQo.getInspectionItemCode();
String max = inspectionSpecQo.getMax();
String mean = inspectionSpecQo.getMean();
String min = inspectionSpecQo.getMin();
String unit = inspectionSpecQo.getUnit();
String inspectionMethod = inspectionSpecQo.getInspectionMethod();
String inspectionStandard = inspectionSpecQo.getInspectionStandard();
String remark = inspectionSpecQo.getRemark();
Locale locale = LocaleContextHolder.getLocale();
QcInspectionItemDict byInspectionItemCode = inspectionItemDictDao.findByInspectionItemCode(inspectionSpecQo.getInspectionItemCode());
if (byInspectionItemCode == null) {
return outputEncapsulationObject(PromptMessageEnum.DATA_NONE, "不存在该字典类型!", locale);
}
QcInspectionSpec inspectionSpec = new QcInspectionSpec();
if (inspectionSpecQo.getId() > 0) {
inspectionSpec.setId(inspectionSpecQo.getId());
}
inspectionSpec.setPartNo(partNo);
inspectionSpec.setInspectionItemCode(inspectionItemCode);
inspectionSpec.setMax(max);
inspectionSpec.setMean(mean);
inspectionSpec.setMin(min);
inspectionSpec.setUnit(unit);
inspectionSpec.setInspectionMethod(inspectionMethod);
inspectionSpec.setInspectionStandard(inspectionStandard);
inspectionSpec.setRemark(remark);
inspectionSpec.setPartNo(inspectionSpecQo.getPartNo());
inspectionSpec.setInspectionItemCode(inspectionSpecQo.getInspectionItemCode());
inspectionSpec.setMax(inspectionSpecQo.getMax());
inspectionSpec.setMean(inspectionSpecQo.getMean());
inspectionSpec.setMin(inspectionSpecQo.getMin());
inspectionSpec.setUnit(inspectionSpecQo.getUnit());
inspectionSpec.setInspectionMethod(inspectionSpecQo.getInspectionMethod());
inspectionSpec.setInspectionStandard(inspectionSpecQo.getInspectionStandard());
inspectionSpec.setRemark(inspectionSpecQo.getRemark());
inspectionSpecDao.save(inspectionSpec);
return outputEncapsulationObject(PromptMessageEnum.SUCCESS, "添加成功!", locale);
}