完善注解

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; import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication @SpringBootApplication
@ComponentScan(basePackages = {"com.xkrs.model.entity"}) //@ComponentScan(basePackages = {"com.xkrs.model.entity", "com.xkrs.controller", "com.xkrs.service"})
public class WordAndExcelApplication { public class WordAndExcelApplication {
public static void main(String[] args) { 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.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import java.util.List;
@ -16,6 +17,7 @@ import java.util.Locale;
import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject; import static com.xkrs.encapsulation.OutputEncapsulation.outputEncapsulationObject;
@RestController
public class QcInspectionSpecController { public class QcInspectionSpecController {
@Resource @Resource

View File

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