去除单据多余的字段
This commit is contained in:
@@ -582,14 +582,6 @@ public class DepotHeadService {
|
||||
String accountmoneylistStr = dh.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", "");
|
||||
dh.setAccountMoneyList(accountmoneylistStr);
|
||||
}
|
||||
if(dh.getOtherMoneyList() != null) {
|
||||
String otherMoneyListStr = dh.getOtherMoneyList().replace("[", "").replace("]", "").replaceAll("\"", "");
|
||||
dh.setOtherMoneyList(otherMoneyListStr);
|
||||
}
|
||||
if(dh.getOtherMoneyItem() != null) {
|
||||
String otherMoneyItemStr = dh.getOtherMoneyItem().replace("[", "").replace("]", "").replaceAll("\"", "");
|
||||
dh.setOtherMoneyItem(otherMoneyItemStr);
|
||||
}
|
||||
if(dh.getChangeAmount() != null) {
|
||||
dh.setChangeAmount(dh.getChangeAmount().abs());
|
||||
}
|
||||
|
||||
@@ -17,7 +17,9 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class MaterialAttributeService {
|
||||
@@ -56,9 +58,28 @@ public class MaterialAttributeService {
|
||||
|
||||
public List<MaterialAttribute> select(String attributeField, int offset, int rows)
|
||||
throws Exception{
|
||||
String[] arr = {"color","size","brand","other1","other2"};
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("color", "颜色");
|
||||
map.put("size", "尺寸");
|
||||
map.put("brand", "品牌");
|
||||
map.put("other1", "自定义1");
|
||||
map.put("other2", "自定义2");
|
||||
List<MaterialAttribute> list = new ArrayList<>();
|
||||
try{
|
||||
list= materialAttributeMapperEx.selectByConditionMaterialAttribute(attributeField, offset, rows);
|
||||
List<MaterialAttribute> maList = materialAttributeMapperEx.selectByConditionMaterialAttribute(attributeField, offset, rows);
|
||||
for(String field: arr) {
|
||||
MaterialAttribute materialAttribute = new MaterialAttribute();
|
||||
materialAttribute.setAttributeField(field);
|
||||
materialAttribute.setAttributeName(map.get(field));
|
||||
for(MaterialAttribute ma: maList) {
|
||||
if(field.equals(ma.getAttributeField())){
|
||||
materialAttribute.setAttributeName(ma.getAttributeName());
|
||||
materialAttribute.setAttributeValue(ma.getAttributeValue());
|
||||
}
|
||||
}
|
||||
list.add(materialAttribute);
|
||||
}
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
|
||||
@@ -63,6 +63,6 @@ public class OrganizationComponent implements ICommonQuery {
|
||||
|
||||
@Override
|
||||
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||
return 0;
|
||||
return organizationService.checkIsNameExist(id, name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class OrganizationService {
|
||||
try{
|
||||
result=organizationMapper.insertSelective(organization);
|
||||
logService.insertLog("机构",
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(organization.getOrgFullName()).toString(),request);
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(organization.getOrgAbr()).toString(),request);
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
@@ -87,7 +87,7 @@ public class OrganizationService {
|
||||
try{
|
||||
result=organizationMapper.updateByPrimaryKeySelective(organization);
|
||||
logService.insertLog("机构",
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(organization.getOrgFullName()).toString(), request);
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(organization.getOrgAbr()).toString(), request);
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class OrganizationService {
|
||||
sb.append(BusinessConstants.LOG_OPERATION_TYPE_DELETE);
|
||||
List<Organization> list = getOrganizationListByIds(ids);
|
||||
for(Organization organization: list){
|
||||
sb.append("[").append(organization.getOrgFullName()).append("]");
|
||||
sb.append("[").append(organization.getOrgAbr()).append("]");
|
||||
}
|
||||
logService.insertLog("机构", sb.toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
@@ -126,10 +126,22 @@ public class OrganizationService {
|
||||
return result;
|
||||
}
|
||||
|
||||
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||
OrganizationExample example = new OrganizationExample();
|
||||
example.createCriteria().andIdNotEqualTo(id).andOrgAbrEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<Organization> list=null;
|
||||
try{
|
||||
list= organizationMapper.selectByExample(example);
|
||||
}catch(Exception e){
|
||||
JshException.readFail(logger, e);
|
||||
}
|
||||
return list==null?0:list.size();
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int addOrganization(Organization org) throws Exception{
|
||||
logService.insertLog("机构",
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(org.getOrgFullName()).toString(),
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(org.getOrgAbr()).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
//新增时间
|
||||
Date date=new Date();
|
||||
@@ -160,7 +172,7 @@ public class OrganizationService {
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int editOrganization(Organization org)throws Exception {
|
||||
logService.insertLog("机构",
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(org.getOrgFullName()).toString(),
|
||||
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(org.getOrgAbr()).toString(),
|
||||
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
|
||||
//修改时间
|
||||
org.setUpdateTime(new Date());
|
||||
|
||||
Reference in New Issue
Block a user