维护产品类型表 jsh_materialcategory

序列号表	jsh_serial_number
用户表	jsh_user
机构表	jsh_organization
机构用户关系表	jsh_orga_user_rel
对应的删除标记
This commit is contained in:
qiankunpingtai
2019-03-28 15:23:53 +08:00
parent e437abb0b0
commit 7dc1cdaafc
13 changed files with 102 additions and 48 deletions

View File

@@ -101,6 +101,9 @@ public class ExceptionConstants {
/**商品%s下序列号不充足请补充后重试*/
public static final int MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE = 10500002;
public static final String MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG = "商品:%s下序列号不充足请补充后重试";
/**删序列号信息失败*/
public static final int SERIAL_NUMBERE_DELETE_FAILED_CODE = 10500003;
public static final String SERIAL_NUMBERE_DELETE_FAILED_MSG = "删序列号信息失败";
/**
* 机构
* type = 110

View File

@@ -76,4 +76,5 @@ public class RoleController {
public List<Role> list(HttpServletRequest request) {
return roleService.getRole();
}
}

View File

@@ -5,14 +5,12 @@ import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.SerialNumberEx;
import com.jsh.erp.exception.BusinessParamCheckingException;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.serialNumber.SerialNumberService;
import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@@ -109,19 +107,26 @@ public class SerialNumberController {
return result;
}
/**
* create by: qiankunpingtai
* websitehttp://39.105.146.63/symphony/
* description:
* 逻辑删除序列号信息
* create time: 2019/3/27 17:43
* @Param: ids
* @return java.lang.Object
*/
@RequestMapping(value = "/serialNumber/batchDeleteSerialNumberByIds")
public Object batchDeleteSerialNumberByIds(@RequestParam("ids") String ids) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess();
int i= serialNumberService.batchDeleteSerialNumberByIds(ids);
if(i<1){
logger.error("异常码[{}],异常提示[{}],参数,ids[{}]",
ExceptionConstants.SERIAL_NUMBERE_DELETE_FAILED_CODE,ExceptionConstants.SERIAL_NUMBERE_DELETE_FAILED_MSG,ids);
throw new BusinessRunTimeException(ExceptionConstants.SERIAL_NUMBERE_DELETE_FAILED_CODE,
ExceptionConstants.SERIAL_NUMBERE_DELETE_FAILED_MSG);
}
return result;
}
}

View File

@@ -60,4 +60,6 @@ public interface SerialNumberMapperEx {
* 批量添加序列号
* */
int batAddSerialNumber(@Param("list") List<SerialNumberEx> list);
int batchDeleteSerialNumberByIds(@Param("updateTime") Date updateTime, @Param("updater") Long updater, @Param("ids") String ids[]);
}

View File

@@ -391,4 +391,23 @@ public class SerialNumberService {
}while(batAddTotal>0);
}
}
/**
* create by: qiankunpingtai
* websitehttp://39.105.146.63/symphony/
* description:
* 逻辑删除序列号信息
* create time: 2019/3/27 17:43
* @Param: ids
* @return
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteSerialNumberByIds(String ids) {
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User userInfo=userService.getCurrentUser();
String [] idArray=ids.split(",");
return serialNumberMapperEx.batchDeleteSerialNumberByIds(new Date(),userInfo==null?null:userInfo.getId(),idArray);
}
}

View File

@@ -112,7 +112,7 @@ public class UserService {
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateUserByObj(User user) {
logService.insertLog(BusinessConstants.LOG_MODULE_NAME_USER,
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(user.getId()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
return userMapper.updateByPrimaryKeySelective(user);
@@ -128,7 +128,7 @@ public class UserService {
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int resetPwd(String md5Pwd, Long id) {
logService.insertLog(BusinessConstants.LOG_MODULE_NAME_USER,
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
User user = new User();
@@ -217,7 +217,7 @@ public class UserService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void addUserAndOrgUserRel(UserEx ue) throws Exception{
logService.insertLog(BusinessConstants.LOG_MODULE_NAME_USER,
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
BusinessConstants.LOG_OPERATION_TYPE_ADD,
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
//检查用户名和登录名
@@ -274,7 +274,7 @@ public class UserService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void updateUserAndOrgUserRel(UserEx ue) throws Exception{
logService.insertLog(BusinessConstants.LOG_MODULE_NAME_USER,
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(ue.getId()).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
//检查用户名和登录名
@@ -405,7 +405,7 @@ public class UserService {
* */
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void batDeleteUser(String ids) {
logService.insertLog(BusinessConstants.LOG_MODULE_NAME_USER,
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_USER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
String idsArray[]=ids.split(",");