|
|
@@ -510,6 +510,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
public int updateServiceOrder(TOrderNewWithBLOBs t, Integer isSubmit) {
|
|
|
Date date=new Date();
|
|
|
TOrderNew t2=tOrderNewMapper.queryById(t.getOrderNo());
|
|
|
+ if (t.getOrderDep()!=null){
|
|
|
+ Department dep = departmentMapper.selectByPrimaryKey(t.getOrderDep());
|
|
|
+ if (dep==null||dep.getStatus().equals("1")){
|
|
|
+ throw new BusinessException("部门不存在或者部门被禁用");
|
|
|
+ }
|
|
|
+ }
|
|
|
//判断手机号码是否存在
|
|
|
if (StringUtils.isNotBlank(t.getContacts())&&StringUtils.isNotBlank(t.getContactMobile())&&
|
|
|
organizationContactBookMapper.checkContacts(t2.getBuyerId(), t2.getContactMobile(),TokenManager.getAdminId()==null?"1":TokenManager.getAdminId() )>0) {
|
|
|
@@ -1077,6 +1083,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
orderProjectService.updateMidServiceProject(t.getOrderNo());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 新建合同编号,优先获取闲置合同编号,否则按年份生成编号
|
|
|
*/
|
|
|
@@ -1096,16 +1103,20 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}else {
|
|
|
//根据前缀查询最大编号
|
|
|
String max=departmentMapper.getMaxAbbreviation(dep.getAbbreviation()+"-");
|
|
|
-
|
|
|
String sno=null;
|
|
|
- if (StringUtils.isBlank(max)||max.length()<13) {
|
|
|
+ //新增如果是科明未开单的信息,直接从指定编号开始
|
|
|
+ if (StringUtils.isEmpty(max)||max.length()<13) {
|
|
|
String cn=""+dep.getAbbreviation()+"-"+y+"0001";
|
|
|
+ if (dep.getAbbreviation().contains("NMKMZL")){
|
|
|
+ cn=""+dep.getAbbreviation()+"-"+y+"00010";
|
|
|
+ }else if (dep.getAbbreviation().contains("KMZL")){
|
|
|
+ cn=""+dep.getAbbreviation()+"-"+y+"00045";
|
|
|
+ }
|
|
|
cn=iterationNo(cn,dep.getAbbreviation(),y,1);
|
|
|
t.setContractNo(cn);
|
|
|
}else {
|
|
|
int ty=Integer.parseInt(max.substring(max.indexOf("-")+1, max.length()-4));
|
|
|
int no=Integer.parseInt(max.substring(max.length()-4, max.length()));
|
|
|
-
|
|
|
//得出字符串
|
|
|
sno = countNo(dep.getAbbreviation(), sno, ty, no);
|
|
|
//迭代得出最后编码
|