修改OTA批号验重问题
This commit is contained in:
+15
-16
@@ -63,17 +63,17 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public OtaBaCxJbxx add(OtaBaCxJbxx otaBaCxJbxx) throws Exception {
|
public OtaBaCxJbxx add(OtaBaCxJbxx otaBaCxJbxx) throws Exception {
|
||||||
String ggpc = otaBaCxJbxx.getGgpc();
|
String djbh = otaBaCxJbxx.getDjbh();
|
||||||
//对比填写记录用的
|
//对比填写记录用的
|
||||||
OtaBaCxJbxx otaBaCxJbxxOld = new OtaBaCxJbxx();
|
OtaBaCxJbxx otaBaCxJbxxOld = new OtaBaCxJbxx();
|
||||||
Date now = new Date();
|
Date now = new Date();
|
||||||
OtaBaCxList otaBaCxList;
|
OtaBaCxList otaBaCxList;
|
||||||
if (StringUtils.isEmpty(otaBaCxJbxx.getOtaId())) {
|
if (StringUtils.isEmpty(otaBaCxJbxx.getOtaId())) {
|
||||||
if (StringUtils.isNotEmpty(ggpc)) {
|
if (StringUtils.isNotEmpty(djbh)) {
|
||||||
List<OtaBaCxJbxx> xxList = this.list();
|
List<OtaBaCxJbxx> xxList = this.list();
|
||||||
for (OtaBaCxJbxx xx : xxList) {
|
for (OtaBaCxJbxx xx : xxList) {
|
||||||
if (ggpc.equals(xx.getGgpc())) {
|
if (djbh.equals(xx.getDjbh())) {
|
||||||
throw new JeroBootException("公告批次重复");
|
throw new JeroBootException("产品登记编号重复");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -87,11 +87,11 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
|||||||
otaBaCxJbxx.setCreateTime(now);
|
otaBaCxJbxx.setCreateTime(now);
|
||||||
} else {
|
} else {
|
||||||
otaBaCxJbxxOld = this.getByOtaId(otaBaCxJbxx.getOtaId());
|
otaBaCxJbxxOld = this.getByOtaId(otaBaCxJbxx.getOtaId());
|
||||||
if (StringUtils.isNotEmpty(ggpc)) {
|
if (StringUtils.isNotEmpty(djbh)) {
|
||||||
List<OtaBaCxJbxx> xxList = this.list();
|
List<OtaBaCxJbxx> xxList = this.list();
|
||||||
for (OtaBaCxJbxx xx : xxList) {
|
for (OtaBaCxJbxx xx : xxList) {
|
||||||
if (!xx.getOtaId().equals(otaBaCxJbxx.getOtaId()) && ggpc.equals(xx.getGgpc())) {
|
if (!xx.getOtaId().equals(otaBaCxJbxx.getOtaId()) && djbh.equals(xx.getDjbh())) {
|
||||||
throw new JeroBootException("公告批次重复");
|
throw new JeroBootException("产品登记编号重复");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -241,26 +241,25 @@ public class OtaBaCxJbxxServiceImpl extends ServiceImpl<OtaBaCxJbxxMapper, OtaBa
|
|||||||
if (cpbh.length() > 500) {
|
if (cpbh.length() > 500) {
|
||||||
throw new JeroBootException("产品登记编号字数超过500");
|
throw new JeroBootException("产品登记编号字数超过500");
|
||||||
}
|
}
|
||||||
jbxx.setDjbh(cpbh);
|
if (StringUtils.isNotEmpty(cpbh)) {
|
||||||
|
|
||||||
row = s.getRow(4);
|
|
||||||
cell = row.getCell(1);
|
|
||||||
String ggpc = ImportFileUtil.getCellValue(cell, wb);
|
|
||||||
if (StringUtils.isNotEmpty(ggpc)) {
|
|
||||||
List<OtaBaCxJbxx> xxList = this.list();
|
List<OtaBaCxJbxx> xxList = this.list();
|
||||||
for (OtaBaCxJbxx xx : xxList) {
|
for (OtaBaCxJbxx xx : xxList) {
|
||||||
if (ggpc.equals(xx.getGgpc())) {
|
if (cpbh.equals(xx.getDjbh())) {
|
||||||
throw new JeroBootException("公告批次重复");
|
throw new JeroBootException("产品登记编号重复");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
jbxx.setGgpc(ggpc);
|
jbxx.setDjbh(cpbh);
|
||||||
|
|
||||||
row = s.getRow(1);
|
row = s.getRow(1);
|
||||||
cell = row.getCell(1);
|
cell = row.getCell(1);
|
||||||
jbxx.setQymc(ImportFileUtil.getCellValue(cell, wb));
|
jbxx.setQymc(ImportFileUtil.getCellValue(cell, wb));
|
||||||
row = s.getRow(3);
|
row = s.getRow(3);
|
||||||
cell = row.getCell(1);
|
cell = row.getCell(1);
|
||||||
jbxx.setCplb(ImportFileUtil.getCellValueDict(cell, wb, "product_category", sysDictService, cut));
|
jbxx.setCplb(ImportFileUtil.getCellValueDict(cell, wb, "product_category", sysDictService, cut));
|
||||||
|
row = s.getRow(4);
|
||||||
|
cell = row.getCell(1);
|
||||||
|
jbxx.setGgpc(ImportFileUtil.getCellValue(cell, wb));
|
||||||
row = s.getRow(5);
|
row = s.getRow(5);
|
||||||
cell = row.getCell(1);
|
cell = row.getCell(1);
|
||||||
jbxx.setCpsb(ImportFileUtil.getCellValue(cell, wb));
|
jbxx.setCpsb(ImportFileUtil.getCellValue(cell, wb));
|
||||||
|
|||||||
Reference in New Issue
Block a user