Commit ec42bb1e authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-12-25

parent 610cc965
...@@ -34,4 +34,6 @@ public interface MpAccountsMapper extends GenericDao<MpAccountsEntity> { ...@@ -34,4 +34,6 @@ public interface MpAccountsMapper extends GenericDao<MpAccountsEntity> {
int insertUserAccount(Map<String, Object> params); int insertUserAccount(Map<String, Object> params);
int getUserAccounts(Map<String, Object> params); int getUserAccounts(Map<String, Object> params);
String getByQyUserAvater(Long id);
} }
...@@ -171,4 +171,7 @@ ...@@ -171,4 +171,7 @@
where userid = #{userid} and accountsid = #{accountsid} where userid = #{userid} and accountsid = #{accountsid}
</update> </update>
<select id="getByQyUserAvater" parameterType="java.lang.Long" resultType="java.lang.String">
SELECT q.avatar FROM t_qyuser q INNER JOIN user u ON q.id = u.userid WHERE q.del_flag = '0' AND u.delflag = '0' AND u.id = #{id}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -88,6 +88,7 @@ public class DataSourceJobThread extends Thread { ...@@ -88,6 +88,7 @@ public class DataSourceJobThread extends Thread {
{ {
try { try {
jedis = jedisPool.getResource(); jedis = jedisPool.getResource();
jedis.auth(DESUtil.decrypt(SystemConfig.r.getProperty("spring.redis.password"),DESUtil.KEY));
log.info("订阅REDIS JOB"); log.info("订阅REDIS JOB");
jedis.subscribe(redisSubPubListener,"job_listener"); jedis.subscribe(redisSubPubListener,"job_listener");
}catch (Exception subScribeException) }catch (Exception subScribeException)
......
...@@ -33,4 +33,10 @@ public interface MpAccountsService extends GenericService<MpAccountsEntity> { ...@@ -33,4 +33,10 @@ public interface MpAccountsService extends GenericService<MpAccountsEntity> {
int insertUserAccounts(Map<String, Object> params); int insertUserAccounts(Map<String, Object> params);
int getUserAccounts(Map<String, Object> params); int getUserAccounts(Map<String, Object> params);
/**
* 获取登陆账号对应的企业微信头像
* @param id
*/
String getByQyUserAvater(Long id);
} }
...@@ -93,4 +93,9 @@ public class MpAccountsServiceImpl extends GenericServiceImpl<MpAccountsEntity> ...@@ -93,4 +93,9 @@ public class MpAccountsServiceImpl extends GenericServiceImpl<MpAccountsEntity>
public int getUserAccounts(Map<String, Object> params) { public int getUserAccounts(Map<String, Object> params) {
return accountsMapper.getUserAccounts(params); return accountsMapper.getUserAccounts(params);
} }
@Override
public String getByQyUserAvater(Long id) {
return accountsMapper.getByQyUserAvater(id);
}
} }
...@@ -30,6 +30,7 @@ public class CommonController { ...@@ -30,6 +30,7 @@ public class CommonController {
@Autowired @Autowired
private PermissionService permissionService; private PermissionService permissionService;
@Autowired @Autowired
private MpAccountsService mpAccountService; private MpAccountsService mpAccountService;
...@@ -86,6 +87,14 @@ public class CommonController { ...@@ -86,6 +87,14 @@ public class CommonController {
request.getSession().setAttribute("permission", allPerms); request.getSession().setAttribute("permission", allPerms);
} }
//获得当前账号
String avatar = mpAccountService.getByQyUserAvater(currentUser.getId());
if (StringUtils.isBlank(avatar)) {
request.getSession().setAttribute("USER_AVATAR", "dist/img/avatar_.jpg");
} else {
request.getSession().setAttribute("USER_AVATAR", avatar);
}
//获得当前账号 //获得当前账号
request.getSession().setAttribute("mpaccounts", accountsEntity.getId()); request.getSession().setAttribute("mpaccounts", accountsEntity.getId());
request.getSession().setAttribute("isshow", "2");//不显示,首页报表图 request.getSession().setAttribute("isshow", "2");//不显示,首页报表图
...@@ -103,6 +112,7 @@ public class CommonController { ...@@ -103,6 +112,7 @@ public class CommonController {
} }
User currentUser = UserUtils.getUser(); User currentUser = UserUtils.getUser();
String roleids= ""; String roleids= "";
List<UserRole> userRole = roleService.selectRolesByUserAccountsId(currentUser.getId(), id); List<UserRole> userRole = roleService.selectRolesByUserAccountsId(currentUser.getId(), id);
for(int i =0;i<userRole.size();i++){ for(int i =0;i<userRole.size();i++){
...@@ -116,8 +126,13 @@ public class CommonController { ...@@ -116,8 +126,13 @@ public class CommonController {
{ {
model.addAttribute("permission",permissionService.getMenuByRoles(roleids)); model.addAttribute("permission",permissionService.getMenuByRoles(roleids));
} }
//获取企业微信头像
//获得当前账号 //获得当前账号
MpAccountsEntity mpAccount=mpAccountService.getDetail(id); MpAccountsEntity mpAccount = mpAccountService.getDetail(id);
String avatar = mpAccountService.getByQyUserAvater(currentUser.getId());
request.getSession().setAttribute("USER_AVATAR", avatar);
request.getSession().setAttribute("mpaccountsDescription", mpAccount.getDescription()); request.getSession().setAttribute("mpaccountsDescription", mpAccount.getDescription());
request.getSession().setAttribute("mpaccounts", id); request.getSession().setAttribute("mpaccounts", id);
//调用微信接口获得 关注数据 详情 //调用微信接口获得 关注数据 详情
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</div> </div>
<div class="form-group form-md-line-input"> <div class="form-group form-md-line-input">
<label>份证号码</label> <label>份证号码</label>
<input type="text" <input type="text"
class="form-control" name="idCard" class="form-control" name="idCard"
id="idCard" id="idCard"
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
var reg = /(^\d{15}$)|(^\d{17}(\d|X)$)/; var reg = /(^\d{15}$)|(^\d{17}(\d|X)$)/;
if(reg.test(card) == false){ if(reg.test(card) == false){
Cfapp.alert({ Cfapp.alert({
message: "请输入正确格式的份证号码", message: "请输入正确格式的份证号码",
btntext: "确定", btntext: "确定",
success: function () { success: function () {
} }
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<tr> <tr>
<td hidden="true">Id</td> <td hidden="true">Id</td>
<th>姓名</th> <th>姓名</th>
<th>份证号码</th> <th>份证号码</th>
<th>描述</th> <th>描述</th>
<th>创建时间</th> <th>创建时间</th>
<th>操作</th> <th>操作</th>
......
...@@ -19,8 +19,8 @@ public class Authentication implements Serializable { ...@@ -19,8 +19,8 @@ public class Authentication implements Serializable {
private Long id; private Long id;
@ExportConfig(value = "姓名", width = 100) @ExportConfig(value = "姓名", width = 100)
private String name; private String name;
/* 份证号码 */ /* 份证号码 */
@ExportConfig(value = "份证号码", width = 100) @ExportConfig(value = "份证号码", width = 100)
private String idCard; private String idCard;
/* 所属的账号 */ /* 所属的账号 */
private Long accountsId; private Long accountsId;
...@@ -36,7 +36,7 @@ public class Authentication implements Serializable { ...@@ -36,7 +36,7 @@ public class Authentication implements Serializable {
private String description; private String description;
/* 创建时间 */ /* 创建时间 */
@ExportConfig(value = "创建时间",width = 150,showLevel = 1) @ExportConfig(value = "创建时间",width = 150, showLevel = 1, dateFormat = "yyyy-MM-dd HH:mm")
private Date createTime; private Date createTime;
/* 创建人 */ /* 创建人 */
private Long createBy; private Long createBy;
......
...@@ -82,6 +82,24 @@ ...@@ -82,6 +82,24 @@
name="consultId" placeholder="咨询单编码"> name="consultId" placeholder="咨询单编码">
</div> </div>
<div class="col-xs-2">
<select id="status" name="status" class="form-control required">
<option value="">请选择审核状态</option>
<option value="0">待审核</option>
<option value="1">已通过</option>
<option value="2">已拒绝</option>
</select>
</div>
<div class="col-xs-2">
<select id="serviceId" name="serviceId" class="form-control required">
<option value="">请选择客服</option>
#foreach($qyuser in $cusServices)
<option value="$!{qyuser.id}">$!{qyuser.name}</option>
#end
</select>
</div>
<div class="col-xs-2"> <div class="col-xs-2">
<div class="input-group date"> <div class="input-group date">
<div class="input-group-addon"> <div class="input-group-addon">
...@@ -196,17 +214,18 @@ ...@@ -196,17 +214,18 @@
src="plugins/jquery-validation/js/jquery.validate.min.js"></script> src="plugins/jquery-validation/js/jquery.validate.min.js"></script>
<!-- AdminLTE for demo purposes --> <!-- AdminLTE for demo purposes -->
<script src="common/js/cfapp.js"></script> <script src="common/js/cfapp.js"></script>
<script src="js/moment.min.js"></script>
<script> <script>
function formatDates(now) { function formatDates(now) {
var now = new Date(now); var now = new Date(now);
var year = now.getFullYear(); var year = now.getFullYear();
var month = now.getMonth() + 1; var month = now.getMonth();
var date = now.getDate(); var date = now.getDate();
var hour = now.getHours(); var hour = now.getHours();
var minute = now.getMinutes(); var minute = now.getMinutes();
var second = now.getSeconds(); var second = now.getSeconds();
return year + "-" + (month <= 9 ? "0" + month : month) + "-" + (date <= 9 ? "0" + date : date) + " " + (hour <= 9 ? "0" + hour : hour) + ":" return year + "-" + month + "-" + date + " " + hour + ":" + minute + ":" + second;
+ (minute <= 9 ? "0" + minute : minute) + ":" + (second <= 9 ? "0" + second : second);
} }
function seachTable() { function seachTable() {
...@@ -218,7 +237,7 @@ ...@@ -218,7 +237,7 @@
} }
var retrieveData = function (sSource, aoData, fnCallback) { var retrieveData = function (sSource, aoData, fnCallback) {
$("#seachTableForm input").each(function () { $("#seachTableForm input,select").each(function () {
var params = { var params = {
name: $(this).attr("name"), name: $(this).attr("name"),
value: $(this).val() value: $(this).val()
...@@ -325,7 +344,6 @@ ...@@ -325,7 +344,6 @@
"mData": "userName", "mData": "userName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (c) { if (c) {
console.log(c.userName);
return c.userName.slice(0, 1) + '*' + c.userName.slice(2, c.userName.length); return c.userName.slice(0, 1) + '*' + c.userName.slice(2, c.userName.length);
} else { } else {
return null; return null;
...@@ -408,7 +426,7 @@ ...@@ -408,7 +426,7 @@
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a) { if (a) {
return formatDates(a); return moment(a).format('YYYY-MM-DD HH:mm:ss');;
} else { } else {
return null; return null;
} }
...@@ -442,7 +460,6 @@ ...@@ -442,7 +460,6 @@
} else { } else {
html += '<li>#if($shiro.hasPermission("qy:consultSheet:view"))<a href="#springUrl("/a/consultSheet/form?pageType=View&id=' + a + '")" class="btn green">查看</a> #end</li>'; html += '<li>#if($shiro.hasPermission("qy:consultSheet:view"))<a href="#springUrl("/a/consultSheet/form?pageType=View&id=' + a + '")" class="btn green">查看</a> #end</li>';
} }
html += '</ul>';
return html; return html;
} }
} }
...@@ -517,9 +534,12 @@ ...@@ -517,9 +534,12 @@
} }
function clearSearch() { function clearSearch() {
$("#seachTableForm input").each(function () { $("#seachTableForm input").each(function() {
$(this).val(''); $(this).val('');
}); });
$("select").each(function() {
$(this).find("option[value='']").prop("selected", true);
});
$("#table").dataTable().fnClearTable(); $("#table").dataTable().fnClearTable();
} }
</script> </script>
......
...@@ -67,28 +67,28 @@ ...@@ -67,28 +67,28 @@
a.number_id numberId, a.number_id numberId,
a.sex, a.sex,
CONVERT(AES_DECRYPT(a.phone,'aideakey') USING UTF8) phone, CONVERT(AES_DECRYPT(a.phone,'aideakey') USING UTF8) phone,
a.past_records, a.past_records pastRecords,
a.prescription, a.prescription,
a.doctor_id, a.doctor_id doctorId,
a.service_id, a.service_id serviceId,
a.illness, a.illness,
a.accounts_id, a.accounts_id accountsId,
a.del_flag, a.del_flag delFlag,
a.STATUS, a.status,
a.create_time, a.create_time createTime,
a.update_time, a.update_time updateTime,
a.description, a.description,
a.create_by, a.create_by createBy,
a.update_by, a.update_by updateBy,
a.allergy, a.allergy,
a.symptom, a.symptom,
a.diagnosis, a.diagnosis,
a.open_id openId, a.open_id openId,
a.drugs_id, a.drugs_id drugsId,
a.member_id, a.member_id memberId,
a.order_id, a.order_id orderId,
a.address_id, a.address_id addressId,
a.audit_time, a.audit_time auditTime,
b.`name` pharmaName, b.`name` pharmaName,
c.`name` customerName c.`name` customerName
</sql> </sql>
...@@ -182,13 +182,13 @@ ...@@ -182,13 +182,13 @@
<select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet"> <select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias <include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias, CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) nickName
FROM t_aidea_consult_sheet a FROM t_aidea_consult_sheet a
LEFT JOIN t_qyuser b ON b.id = a.doctor_id LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id LEFT JOIN t_qyuser c ON c.id = a.service_id
LEFT JOIN t_qyuser d ON d.id = a.past_records LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_orgunit e ON e.id = a.allergy LEFT JOIN t_orgunit e ON e.id = a.allergy
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id AND f.delflag = 0
WHERE a.id = #{id} WHERE a.id = #{id}
GROUP BY id GROUP BY id
</select> </select>
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
LEFT JOIN t_qyuser b ON b.id = a.doctor_id LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id LEFT JOIN t_qyuser c ON c.id = a.service_id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="id!=null">and (a.doctor_id = ${id} or a.service_id =${id} )</if> <if test="id!=null">AND (a.doctor_id = ${id} or a.service_id =${id})</if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
</select> </select>
......
...@@ -92,6 +92,7 @@ public class ConsultSheet extends UserSheet implements Serializable { ...@@ -92,6 +92,7 @@ public class ConsultSheet extends UserSheet implements Serializable {
private String hospital;//处方医院 private String hospital;//处方医院
private String pharmacist;//处方医生 private String pharmacist;//处方医生
private String fansAlias;//粉丝别名 private String fansAlias;//粉丝别名
private String nickName;//昵称
public ConsultSheet() { public ConsultSheet() {
this.delFlag = false; this.delFlag = false;
......
...@@ -101,6 +101,12 @@ public class ConsultSheetController { ...@@ -101,6 +101,12 @@ public class ConsultSheetController {
@RequestMapping("/list") @RequestMapping("/list")
public String list(HttpServletRequest request, Model model) { public String list(HttpServletRequest request, Model model) {
Long accountId = UserUtils.getmpaccounts(request); Long accountId = UserUtils.getmpaccounts(request);
Conds conds = new Conds();
conds.equal("t.del_flag", Constants.DEL_FLAG_0);
conds.equal("t.user_type", "2");//客服
List<Qyuser> qyuserList = qyuserService.fetchSearchByPage(conds, null, 0, 0);
model.addAttribute("cusServices", qyuserList);
model.addAttribute("accountId", accountId); model.addAttribute("accountId", accountId);
return "consultSheet/consultSheetlist"; return "consultSheet/consultSheetlist";
} }
...@@ -187,6 +193,12 @@ public class ConsultSheetController { ...@@ -187,6 +193,12 @@ public class ConsultSheetController {
if (StringUtils.isNoneBlank(consultSheet.getConsultId())) { if (StringUtils.isNoneBlank(consultSheet.getConsultId())) {
conds.like("a.consult_id", "%" + consultSheet.getConsultId() + "%"); conds.like("a.consult_id", "%" + consultSheet.getConsultId() + "%");
} }
if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus());
}
if (consultSheet.getServiceId() != null) {
conds.equal("a.service_id", consultSheet.getServiceId());
}
if (StringUtils.isNoneBlank(consultSheet.getStartCreateTime())) { if (StringUtils.isNoneBlank(consultSheet.getStartCreateTime())) {
conds.greatEqual("DATE_FORMAT(a.create_time, '%Y-%m-%d')", consultSheet.getStartCreateTime()); conds.greatEqual("DATE_FORMAT(a.create_time, '%Y-%m-%d')", consultSheet.getStartCreateTime());
} }
...@@ -238,6 +250,12 @@ public class ConsultSheetController { ...@@ -238,6 +250,12 @@ public class ConsultSheetController {
if (StringUtils.isNoneBlank(consultSheet.getConsultId())) { if (StringUtils.isNoneBlank(consultSheet.getConsultId())) {
conds.like("a.consult_id", "%" + consultSheet.getConsultId() + "%"); conds.like("a.consult_id", "%" + consultSheet.getConsultId() + "%");
} }
if (StringUtils.isNoneBlank(consultSheet.getStatus())) {
conds.equal("a.status", consultSheet.getStatus());
}
if (consultSheet.getServiceId() != null) {
conds.equal("a.service_id", consultSheet.getServiceId());
}
if (StringUtils.isNoneBlank(consultSheet.getStartCreateTime())) { if (StringUtils.isNoneBlank(consultSheet.getStartCreateTime())) {
conds.greatEqual("DATE_FORMAT(a.create_time, '%Y-%m-%d')", consultSheet.getStartCreateTime()); conds.greatEqual("DATE_FORMAT(a.create_time, '%Y-%m-%d')", consultSheet.getStartCreateTime());
} }
...@@ -529,7 +547,9 @@ public class ConsultSheetController { ...@@ -529,7 +547,9 @@ public class ConsultSheetController {
} }
//推送客服消息 //推送客服消息
String msg = SystemConfig.p.getProperty("QY_SEND_SERVICE_AUDIT_FAIL_MAG") + consultSheet.getConsultId(); String msg = SystemConfig.p.getProperty("QY_SEND_SERVICE_AUDIT_FAIL_MAG") + consultSheet.getConsultId() + ";患者昵称:" +
(StringUtils.isNoneBlank(consultSheet.getNickName()) ? consultSheet.getNickName() : "") + ";患者别名:" +
consultSheet.getFansAlias() + ";患者openid:"+consultSheet.getOpenId();
qyMsgUtil.sendText(accounts, false, qyusers, null, null, agenId, msg, false); qyMsgUtil.sendText(accounts, false, qyusers, null, null, agenId, msg, false);
return true; return true;
} }
......
...@@ -67,28 +67,28 @@ ...@@ -67,28 +67,28 @@
a.number_id numberId, a.number_id numberId,
a.sex, a.sex,
CONVERT(AES_DECRYPT(a.phone,'aideakey') USING UTF8) phone, CONVERT(AES_DECRYPT(a.phone,'aideakey') USING UTF8) phone,
a.past_records, a.past_records pastRecords,
a.prescription, a.prescription,
a.doctor_id, a.doctor_id doctorId,
a.service_id, a.service_id serviceId,
a.illness, a.illness,
a.accounts_id, a.accounts_id accountsId,
a.del_flag, a.del_flag delFlag,
a.STATUS, a.status,
a.create_time, a.create_time createTime,
a.update_time, a.update_time updateTime,
a.description, a.description,
a.create_by, a.create_by createBy,
a.update_by, a.update_by updateBy,
a.allergy, a.allergy,
a.symptom, a.symptom,
a.diagnosis, a.diagnosis,
a.open_id openId, a.open_id openId,
a.drugs_id, a.drugs_id drugsId,
a.member_id, a.member_id memberId,
a.order_id, a.order_id orderId,
a.address_id, a.address_id addressId,
a.audit_time, a.audit_time auditTime,
b.`name` pharmaName, b.`name` pharmaName,
c.`name` customerName c.`name` customerName
</sql> </sql>
...@@ -182,13 +182,13 @@ ...@@ -182,13 +182,13 @@
<select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet"> <select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias <include refid="sqlColumns"/>, d.name pharmacist, e.org_name hospital, f.store fansAlias, CONVERT(AES_DECRYPT(f.nickname,'aideakey') USING UTF8) nickName
FROM t_aidea_consult_sheet a FROM t_aidea_consult_sheet a
LEFT JOIN t_qyuser b ON b.id = a.doctor_id LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id LEFT JOIN t_qyuser c ON c.id = a.service_id
LEFT JOIN t_qyuser d ON d.id = a.past_records LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_orgunit e ON e.id = a.allergy LEFT JOIN t_orgunit e ON e.id = a.allergy
LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id LEFT JOIN wx_mp_fanss f ON f.openid = a.open_id AND f.delflag = 0
WHERE a.id = #{id} WHERE a.id = #{id}
GROUP BY id GROUP BY id
</select> </select>
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
LEFT JOIN t_qyuser b ON b.id = a.doctor_id LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id LEFT JOIN t_qyuser c ON c.id = a.service_id
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="id!=null">and (a.doctor_id = ${id} or a.service_id =${id} )</if> <if test="id!=null">AND (a.doctor_id = ${id} or a.service_id =${id})</if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
</select> </select>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
user_name = AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'), user_name = AES_ENCRYPT(#{userName, jdbcType=VARBINARY},'aideakey'),
</if> </if>
<if test="numberId != null"> <if test="numberId != null">
number_id = #{numberId, jdbcType=VARBINARY}, number_id = #{numberId, jdbcType=VARCHAR},
</if> </if>
<if test="sex != null"> <if test="sex != null">
sex = #{sex, jdbcType=BIGINT}, sex = #{sex, jdbcType=BIGINT},
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
<result column="operator" property="operator"/> <result column="operator" property="operator"/>
<result column="openId" property="openId"/> <result column="openId" property="openId"/>
<result column="number" property="number"/> <result column="number" property="number"/>
<result column="invoice_code" property="invoiceCode"/>
<result column="invoice_num" property="invoiceNum"/>
</resultMap> </resultMap>
<resultMap id="resultMapDetail" type="com.cftech.invoice.model.InvoiceDetail"> <resultMap id="resultMapDetail" type="com.cftech.invoice.model.InvoiceDetail">
...@@ -46,6 +48,8 @@ ...@@ -46,6 +48,8 @@
<result column="invoiceContent" property="invoiceContent"/> <result column="invoiceContent" property="invoiceContent"/>
<result column="invoiceStatus" property="invoiceStatus"/> <result column="invoiceStatus" property="invoiceStatus"/>
<result column="invoiceCreateTime" property="invoiceCreateTime"/> <result column="invoiceCreateTime" property="invoiceCreateTime"/>
<result column="invoice_code" property="invoiceCode"/>
<result column="invoice_num" property="invoiceNum"/>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
...@@ -98,7 +102,9 @@ ...@@ -98,7 +102,9 @@
create_by, create_by,
update_by, update_by,
operator, operator,
open_id open_id,
invoice_code,
invoice_num
</sql> </sql>
...@@ -132,7 +138,9 @@ ...@@ -132,7 +138,9 @@
#{createBy, jdbcType=BIGINT}, #{createBy, jdbcType=BIGINT},
#{updateBy, jdbcType=BIGINT}, #{updateBy, jdbcType=BIGINT},
#{operator, jdbcType=VARCHAR}, #{operator, jdbcType=VARCHAR},
#{openId, jdbcType=VARCHAR} #{openId, jdbcType=VARCHAR},
#{invoiceCode, jdbcType=VARCHAR},
#{invoiceNum, jdbcType=VARCHAR}
) )
</insert> </insert>
...@@ -160,12 +168,12 @@ ...@@ -160,12 +168,12 @@
<select id="selectInvoiceDetail" parameterType="java.util.Map" resultMap="resultMapDetail"> <select id="selectInvoiceDetail" parameterType="java.util.Map" resultMap="resultMapDetail">
SELECT SELECT
o.id id, i.id id,
o.number number, o.number number,
o.create_time createTime, o.create_time createTime,
o.confirm confirm, o.confirm confirm,
o.`status` STATUS, o.`status` STATUS,
o.total_amount totalAmount, o.order_amount totalAmount,
p.product_name productName, p.product_name productName,
p.format format, p.format format,
p.unit unit, p.unit unit,
...@@ -176,7 +184,9 @@ ...@@ -176,7 +184,9 @@
i.invoice_type invoiceType, i.invoice_type invoiceType,
i.invoice_content invoiceContent, i.invoice_content invoiceContent,
i.`status` invoiceStatus, i.`status` invoiceStatus,
i.create_time invoiceCreateTime i.create_time invoiceCreateTime,
i.invoice_code invoiceCode,
i.invoice_num invoiceNum
FROM FROM
t_order o t_order o
LEFT JOIN t_order_details d ON d.order_id = o.id LEFT JOIN t_order_details d ON d.order_id = o.id
...@@ -258,6 +268,12 @@ ...@@ -258,6 +268,12 @@
<if test="openId != null"> <if test="openId != null">
open_id = #{openId,jdbcType=VARCHAR}, open_id = #{openId,jdbcType=VARCHAR},
</if> </if>
<if test="invoiceCode != null">
invoice_code = #{invoiceCode,jdbcType=VARCHAR},
</if>
<if test="invoiceNum != null">
invoice_num = #{invoiceNum,jdbcType=VARCHAR}
</if>
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
......
...@@ -79,6 +79,12 @@ public class Invoice implements Serializable { ...@@ -79,6 +79,12 @@ public class Invoice implements Serializable {
*/ */
private String operator; private String operator;
//发票代码
private String invoiceCode;
//发票号码
private String invoiceNum;
public Invoice() { public Invoice() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
......
...@@ -11,7 +11,7 @@ import lombok.Data; ...@@ -11,7 +11,7 @@ import lombok.Data;
public class InvoiceDetail { public class InvoiceDetail {
/** /**
* 订单ID * 发票id
*/ */
private String id; private String id;
/** /**
......
...@@ -25,4 +25,21 @@ public interface InvoiceService extends GenericService<Invoice> { ...@@ -25,4 +25,21 @@ public interface InvoiceService extends GenericService<Invoice> {
* @return * @return
*/ */
JSONObject selectInvoiceDetail(InvoiceDetail invoiceDetail); JSONObject selectInvoiceDetail(InvoiceDetail invoiceDetail);
/**
* 获取粉丝最近邮箱
* @param openid
* @return
*/
JSONObject findFassDefaultEmail(String openid);
/**
* 发送邮箱
* @param appId
* @param openId
* @param orderId
* @param email
* @return
*/
JSONObject sendEmail(String appId, String openId, String invoiceId, String email);
} }
package com.cftech.invoice.service.impl; package com.cftech.invoice.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.model.MpAccountsEntity; import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService; import com.cftech.accounts.service.MpAccountsService;
...@@ -13,9 +14,11 @@ import com.cftech.invoice.service.InvoiceService; ...@@ -13,9 +14,11 @@ import com.cftech.invoice.service.InvoiceService;
import com.cftech.core.generic.GenericDao; import com.cftech.core.generic.GenericDao;
import com.cftech.core.generic.GenericServiceImpl; import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.invoice.web.InvoiceHttpUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -79,4 +82,80 @@ public class InvoiceServiceImpl extends GenericServiceImpl<Invoice> implements I ...@@ -79,4 +82,80 @@ public class InvoiceServiceImpl extends GenericServiceImpl<Invoice> implements I
return jsonObject; return jsonObject;
} }
@Override
public JSONObject findFassDefaultEmail(String openid) {
JSONObject retObj = new JSONObject();
if (StringUtils.isBlank(openid)) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "Fanss OpenId is not find ");
return retObj;
}
Conds conds = new Conds();
conds.equal("open_id", openid);
Sort sort = new Sort("create_time", OrderType.DESC);
Map<String, Object> params = new HashMap<>();
params.put("conds", conds);
params.put("sort", sort);
List<Invoice> invoices = invoiceMapper.fetchSearchByPage(params);
if (invoices != null && invoices.size() > 0) {
retObj.put("errorNo", 0);
retObj.put("data", invoices.get(0).getEmail());
return retObj;
}
retObj.put("errorNo", 1);
retObj.put("errorMsg", " data is null ");
return retObj;
}
@Override
@Transactional
public JSONObject sendEmail(String appId, String openId, String invoiceId, String email) {
JSONObject retObj = new JSONObject();
Invoice invoice = invoiceMapper.fetchById(invoiceId);
if (invoice == null) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "entity is null");
return retObj;
}
//查询开票详情,存储发票代码以及号码
if (StringUtils.isBlank(invoice.getInvoiceCode()) || StringUtils.isBlank(invoice.getInvoiceNum())) {
String result = InvoiceHttpUtil.queryInvoiceResult(invoice);
if (StringUtils.isNotBlank(result) && result.contains("code")) {
JSONObject obj = JSONObject.parseObject(result);
if (obj.getString("code").equals("E0000")) {
JSONArray arr = obj.getJSONArray("result");
for (int i=0; i<arr.size(); i++) {
JSONObject invoiceObj = arr.getJSONObject(i);
if (invoice.getInvoiceSerialNum().equals(invoiceObj.getString("serialNo")) && invoiceObj.getString("status").equals("2")) {
invoice.setInvoiceCode(invoiceObj.getString("invoiceCode"));
invoice.setInvoiceNum(invoiceObj.getString("invoiceNum"));
invoice.setDescription(result);
invoiceMapper.update(invoice);
} else if (invoice.getInvoiceSerialNum().equals(invoiceObj.getString("serialNo")) && !invoiceObj.getString("status").equals("2")) {
invoice.setDescription(result);
invoiceMapper.update(invoice);
retObj.put("errorNo", 1);
retObj.put("errorMsg", invoiceObj.getString("statusMsg"));
return retObj;
}
}
}
}
}
String result = InvoiceHttpUtil.deliveryInvoice(invoice, email);
JSONObject obj = JSONObject.parseObject(result);
if (obj.containsKey("code") && obj.getString("code").equals("E0000")) {
retObj.put("errorNo", 0);
retObj.put("errorMsg", "推送成功");
return retObj;
}
retObj.put("errorNo", 1);
retObj.put("errorMsg", obj.getString("describe"));
return retObj;
}
} }
\ No newline at end of file
package com.cftech.invoice.web;
import com.alibaba.fastjson.JSONObject;
import com.cftech.core.util.SystemConfig;
import com.cftech.invoice.model.Invoice;
import lombok.extern.slf4j.Slf4j;
import nuonuo.open.sdk.NNOpenSDK;
import org.springframework.stereotype.Component;
import java.util.UUID;
/**
* Created by 16444 on 2020/12/23.
*/
@Slf4j
@Component
public class InvoiceHttpUtil {
//授权企业税号
private static String taxNum = SystemConfig.p.getProperty("INVOICE_TAX");
//appkey
private static String appKey = SystemConfig.p.getProperty("APP_KEY");
//appSecrt
private static String appSecret = SystemConfig.p.getProperty("APP_SECRET");
//访问令牌
private static String token = SystemConfig.p.getProperty("INVOICE_TOKEN");
//SDK请求地址
private static String url = SystemConfig.p.getProperty("INVOICE_URL");
private static String genarateUUID() {
return UUID.randomUUID().toString().replace("-", "");
}
public static String queryInvoiceResult(Invoice invoice) {
JSONObject params = new JSONObject();
params.put("serialNos", new String[]{invoice.getInvoiceSerialNum()});
params.put("isOfferInvoiceDetail", "0");//提供发票明细
String method = SystemConfig.p.getProperty("INVOICE_QUERY_API");
NNOpenSDK sdk = NNOpenSDK.getIntance();
String result = sdk.sendPostSyncRequest(url, genarateUUID(), appKey, appSecret, token, taxNum, method, params.toString());
log.info("发票结果查询" + result);
return result;
}
public static String deliveryInvoice(Invoice invoice, String email) {
JSONObject params = new JSONObject();
params.put("taxnum", taxNum);
params.put("invoiceCode", invoice.getInvoiceCode());//发票代码
params.put("invoiceNum", invoice.getInvoiceNum());//发票号码
params.put("mail", email);
String method = SystemConfig.p.getProperty("INVOICE_SEND_EMAIL_API");
NNOpenSDK sdk = NNOpenSDK.getIntance();
String result = sdk.sendPostSyncRequest(url, genarateUUID(), appKey, appSecret, token, taxNum, method, params.toString());
log.info("发票结果查询" + result);
return result;
}
}
...@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
...@@ -28,4 +29,26 @@ public class MobileInvoiceController { ...@@ -28,4 +29,26 @@ public class MobileInvoiceController {
return invoiceService.selectInvoiceDetail(invoiceDetail); return invoiceService.selectInvoiceDetail(invoiceDetail);
} }
/**
* 通过openid获取已填写邮箱
* @param openid
* @return
*/
@RequestMapping(value = "/findFassDefaultEmail", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject findFassDefaultEmail(@RequestParam String openid) {
return invoiceService.findFassDefaultEmail(openid);
}
/**
* 重新发送邮箱
* @param appId
* @param invoiceId
* @param openId
* @param email
* @return
*/
@RequestMapping(value = "/sendEmail", method = {RequestMethod.POST}, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject sendEmail(@RequestParam String appId, @RequestParam String invoiceId, @RequestParam String openId, @RequestParam String email) {
return invoiceService.sendEmail(appId, openId, invoiceId, email);
}
} }
...@@ -96,13 +96,12 @@ ...@@ -96,13 +96,12 @@
<thead> <thead>
<tr> <tr>
<td hidden="true">Id</td> <td hidden="true">Id</td>
<td>运单号</td> <td>运单号</td>
<td>订单号</td> <td>订单号</td>
<td>路由节点发生时间</td> <td>路由节点发生时间</td>
<td>物流编码</td> <td>路由节点描述</td>
<td>路由节点发生地</td> <td>路由节点发生地</td>
<td>路由节点操作码</td> <td>路由节点操作码</td>
<td>路由节点描述</td>
<th>创建时间</th> <th>创建时间</th>
</tr> </tr>
</thead> </thead>
...@@ -217,9 +216,6 @@ ...@@ -217,9 +216,6 @@
{ {
"mData":"opcode" "mData":"opcode"
}, },
{
"mData":"description"
},
{ {
"mData": "createTime" "mData": "createTime"
}], }],
...@@ -238,7 +234,7 @@ ...@@ -238,7 +234,7 @@
}, },
{ {
"aTargets": [8], "aTargets": [7],
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
#{id, jdbcType=BIGINT}, #{id, jdbcType=BIGINT},
#{mailNo, jdbcType=VARCHAR}, #{mailNo, jdbcType=VARCHAR},
#{orderNo, jdbcType=VARCHAR}, #{orderNo, jdbcType=VARCHAR},
now(), #{acceptTime, jdbcType=TIMESTAMP},
#{number, jdbcType=VARCHAR}, #{number, jdbcType=VARCHAR},
#{acceptAddress, jdbcType=VARCHAR}, #{acceptAddress, jdbcType=VARCHAR},
#{opcode, jdbcType=VARCHAR}, #{opcode, jdbcType=VARCHAR},
......
...@@ -122,9 +122,9 @@ ...@@ -122,9 +122,9 @@
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" resultMap="resultMap"> <select id="fetchSearchByPage" parameterType="java.util.Map" resultType="com.cftech.orderdetail.model.OrderDetails">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>, t.common_name commonName, t.format format, t.unit unit
FROM t_order_details d FROM t_order_details d
LEFT JOIN t_order o ON o.id = d.order_id LEFT JOIN t_order o ON o.id = d.order_id
LEFT JOIN t_aidea_product t ON d.drugs_id = t.id LEFT JOIN t_aidea_product t ON d.drugs_id = t.id
...@@ -132,7 +132,6 @@ ...@@ -132,7 +132,6 @@
<if test="userId!=null"> AND (o.service_id = ${userId} OR o.clerk_id = ${userId} OR o.doctor_id = ${userId}) </if> <if test="userId!=null"> AND (o.service_id = ${userId} OR o.clerk_id = ${userId} OR o.doctor_id = ${userId}) </if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
</select> </select>
<update id="update" parameterType="com.cftech.orderdetail.model.OrderDetails"> <update id="update" parameterType="com.cftech.orderdetail.model.OrderDetails">
......
...@@ -69,6 +69,13 @@ public class OrderDetails implements Serializable { ...@@ -69,6 +69,13 @@ public class OrderDetails implements Serializable {
/* 更新人 */ /* 更新人 */
private Long updateBy; private Long updateBy;
/**
* 商品数据
*/
private String commonName;//商品通用名称
private String format;//药品规格
private String unit;//药品单位
public OrderDetails() { public OrderDetails() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
......
...@@ -300,12 +300,19 @@ ...@@ -300,12 +300,19 @@
var avgTime = 30; var avgTime = 30;
var lastTime = 0;//最后一次扫码时间 var lastTime = 0;//最后一次扫码时间
//触发顺序keydown keypress keyup
function initScanEvent() {
$(document).on('keydown', function(event) {
//键盘按下回车后会转换成click 阻止键盘的所有默认行为
event.preventDefault();
console.log('扫码开始');
scanCode(event);
});
}
function scanCode(event) { function scanCode(event) {
let subCode = String.fromCharCode(event.keyCode); let subCode = String.fromCharCode(event.keyCode);
console.log(event.keyCode + "==");
let currTime = new Date().getTime();//当前时间 let currTime = new Date().getTime();//当前时间
let spaceTime = currTime - lastTime;//间隔时间 let spaceTime = currTime - lastTime;//间隔时间
//扫码间隔大于30,未认为输入 //扫码间隔大于30,未认为输入
...@@ -336,39 +343,53 @@ ...@@ -336,39 +343,53 @@
if (!flag) { if (!flag) {
$("#labels").text("商品不在订单中"); $("#labels").text("商品不在订单中");
$('#exampleModal').modal('show'); $('#exampleModal').modal('show');
lastTime = 0;
console.log('扫码结束');
} else { } else {
let orderNum = $("#group").find('input[name="orderNum"]:eq('+index+')').val(); let orderNum = $("#group").find('input[name="orderNum"]:eq('+index+')').val();
let sendNum = $("#group").find('input[name="sendNum"]:eq('+index+')').val(); let sendNum = $("#group").find('input[name="sendNum"]:eq('+index+')').val();
if (parseInt(sendNum) >= parseInt(orderNum)) { if (parseInt(sendNum) >= parseInt(orderNum)) {
$("#labels").text("超过订单商品数量"); $("#labels").text("超过订单商品数量");
$('#exampleModal').modal('show'); $('#exampleModal').modal('show');
lastTime = 0;
console.log('扫码结束');
} else { } else {
$("#group").find('input[name="sendNum"]:eq('+index+')').val(parseInt(sendNum) + 1); $("#group").find('input[name="sendNum"]:eq('+index+')').val(parseInt(sendNum) + 1);
sumScanCode += scanSubCode + "|"; sumScanCode += scanSubCode + "#";
$('textarea[name="scanGoodsCode"]').text(sumScanCode); $('textarea[name="scanGoodsCode"]').text(sumScanCode);
lastTime = 0;
console.log('扫码结束');
} }
} }
scanSubCode = ""; scanSubCode = "";
} }
} }
//触发顺序keydown keypress keyup function delGoodsFun() {
$(document).on('keydown', function(event){ $('.list-group').on('click', '.delGoods', function() {
console.log("触发1"); console.log("删除");
scanCode(event); let productCode = $(this).parent().find('input[name="productCode"]').val();
let numbers = $(this).parent().find('input[name="sendNum"]').val();
let scanGoods = $('textarea[name="scanGoodsCode"]').text();
if (numbers > 0 && scanGoods.indexOf(productCode) > -1) {
$(this).parent().find('input[name="sendNum"]').val(numbers - 1);
let arrStr = scanGoods.split('#');
for (let i=0; i<arrStr.length; i++) {
if (arrStr[i] == productCode) {
arrStr.splice(i, 1);
break;
}
}
sumScanCode = arrStr.join('#');
$('textarea[name="scanGoodsCode"]').text(sumScanCode);
} else {
$("#labels").text("商品数量已为0件无法删除");
$('#exampleModal').modal('show');
sumScanCode="";
}
}); });
}
// $(document).on('keypress', function(event){
// if(event.keyCode == 13){
// //alert('你按下了Enter' + 2);
// }
// });
//
// $(document).on('keyup', function(event){
// if(event.keyCode == 13){
// //alert('你按下了Enter' + 3);
// }
// });
function list() { function list() {
...@@ -389,7 +410,6 @@ ...@@ -389,7 +410,6 @@
selectProductList = JSON.parse(selectProductList); selectProductList = JSON.parse(selectProductList);
for (var i = 0; i < selectProductList.length; i++) { for (var i = 0; i < selectProductList.length; i++) {
var obj = selectProductList[i]; var obj = selectProductList[i];
console.log(obj);
clickAdd(obj.id, obj.productId, obj.productName, obj.drugsNum, obj.price, obj.amount, obj.productNumber); clickAdd(obj.id, obj.productId, obj.productName, obj.drugsNum, obj.price, obj.amount, obj.productNumber);
} }
} }
...@@ -416,9 +436,10 @@ ...@@ -416,9 +436,10 @@
if (confirm = '0') { if (confirm = '0') {
$("#divClass").css('display', 'blocks') $("#divClass").css('display', 'blocks')
} }
Cfapp.init(); Cfapp.init();
initScanEvent();
delGoodsFun();
list(); list();
}); });
...@@ -454,7 +475,7 @@ ...@@ -454,7 +475,7 @@
var HtmlAmount = `<input name="sendNum" class="form-control" type="text" style="width: 180px ;margin-right: 50px;" readonly value="0"></input>`; var HtmlAmount = `<input name="sendNum" class="form-control" type="text" style="width: 180px ;margin-right: 50px;" readonly value="0"></input>`;
//扫码商品编码 //扫码商品编码
var HtmlCode = `<button name="delGoods" type="button" class="btn btn-danger">删除</button>`; var HtmlCode = `<button name="delGoods" type="button" class="btn btn-danger delGoods">删除</button>`;
let html = `<li id="form-translate" class="list-group-item" style="display:flex;"> let html = `<li id="form-translate" class="list-group-item" style="display:flex;">
...@@ -534,7 +555,7 @@ ...@@ -534,7 +555,7 @@
bindEvent(); bindEvent();
}; };
var bindEvent = function () { var bindEvent = function () {
$('.scanCode').focus();
}; };
initFormCtrl(); initFormCtrl();
}; };
......
...@@ -155,12 +155,16 @@ ...@@ -155,12 +155,16 @@
maxlength="50" placeholder="" maxlength="50" placeholder=""
value="$!{data.createTime}" value="$!{data.createTime}"
> >
</div> </div>
<div class="form-group form-md-line-input col-xs-8"> <div class="form-group form-md-line-input col-xs-5">
<label>订单取消原因<font style="color: red"></font></label> <label>openid<font style="color: red"></font></label>
<textarea class="form-control" id="orderCancel" name="orderCancel" rows="3" readonly>$!{data.orderCancel}</textarea> <input type="text"
class="form-control" name="openid"
id="openid" readonly="readonly"
maxlength="50" placeholder=""
value="$!{data.openid}"
>
</div> </div>
<div class="form-group form-md-line-input col-xs-5"> <div class="form-group form-md-line-input col-xs-5">
...@@ -173,14 +177,25 @@ ...@@ -173,14 +177,25 @@
> >
</div> </div>
<div class="form-group form-md-line-input col-xs-10"> <div class="form-group form-md-line-input col-xs-8">
<label>订单取消原因<font style="color: red"></font></label>
<textarea class="form-control" id="orderCancel" name="orderCancel" rows="3" readonly>$!{data.orderCancel}</textarea>
</div>
<div class="form-group form-md-line-input col-xs-8">
<label>付款链接<font style="color: red"></font></label> <label>付款链接<font style="color: red"></font></label>
<div style="display: flex; justify-content: center; align-items: center;">
<input type="text" <input type="text"
class="form-control" name="payUrl" class="form-control" name="payUrl"
id="payUrl" readonly="readonly" id="payUrl" readonly="readonly"
maxlength="50" placeholder="" maxlength="50" placeholder=""
value="$!{data.payUrl}" value="$!{data.payUrl}"
> >
<button type="button" class="btn btn-info" onclick="copy(this)">复制</button>
</div>
</div> </div>
<div class="form-group form-md-line-input col-xs-10"> <div class="form-group form-md-line-input col-xs-10">
...@@ -536,7 +551,36 @@ ...@@ -536,7 +551,36 @@
}); });
} }
/**
* 复制付款链接
* @param ele
*/
function copy(ele) {
let text = $(ele).prev().val();
let input = document.createElement('input');
input.setAttribute('readonly', 'readonly'); // 防止手机上弹出软键盘
input.setAttribute('value', text);
document.body.appendChild(input);
input.select();
var res = document.execCommand('copy');
document.body.removeChild(input);
if (res) {
Cfapp.alert({
message: "链接复制成功!",
btntext: "确定",
success: function () { }
});
} else {
Cfapp.alert({
message: "链接复制失败!",
btntext: "确定",
success: function () { }
});
}
}
let qrcodeUrl = `$!{data.payUrl}`; let qrcodeUrl = `$!{data.payUrl}`;
if (qrcodeUrl != null && qrcodeUrl != '') {
var qrcode = new QRCode("qrcodeDiv", var qrcode = new QRCode("qrcodeDiv",
{ {
render: "canvas", //也可以替换为table render: "canvas", //也可以替换为table
...@@ -544,6 +588,7 @@ ...@@ -544,6 +588,7 @@
height: 200, height: 200,
text: qrcodeUrl text: qrcodeUrl
}); });
}
</script> </script>
</body> </body>
<!-- END BODY --> <!-- END BODY -->
......
...@@ -260,10 +260,10 @@ ...@@ -260,10 +260,10 @@
<th>付款金额</th> <th>付款金额</th>
<th>昵称</th> <th>昵称</th>
<th>别名</th> <th>别名</th>
<th>openid</th> <!--<th>openid</th>-->
<th>顺丰运单号</th> <th>顺丰运单号</th>
<th>订单状态</th> <th>订单状态</th>
<th>支付交易号</th> <!--<th>支付交易号</th>-->
<th>是否开票</th> <th>是否开票</th>
<th>创建时间</th> <th>创建时间</th>
<th>确认时间</th> <th>确认时间</th>
...@@ -379,6 +379,9 @@ ...@@ -379,6 +379,9 @@
"sAjaxSource": sSource, "sAjaxSource": sSource,
"fnServerData": retrieveData, "fnServerData": retrieveData,
"pagingType": "full_numbers", "pagingType": "full_numbers",
"autowidth": true,
"scrollX": true,
"sScrollY":"450px",
"aoColumns": [ "aoColumns": [
{ {
"mData": "id" "mData": "id"
...@@ -407,10 +410,10 @@ ...@@ -407,10 +410,10 @@
{ {
"mData": "fansAlias" "mData": "fansAlias"
} }
, // ,
{ // {
"mData": "openid" // "mData": "openid"
} // }
, ,
{ {
"mData": "courierNumber" "mData": "courierNumber"
...@@ -419,10 +422,10 @@ ...@@ -419,10 +422,10 @@
{ {
"mData": "status" "mData": "status"
} }
, // ,
{ // {
"mData": "tradeNo" // "mData": "tradeNo"
} // }
, ,
{ {
...@@ -464,7 +467,7 @@ ...@@ -464,7 +467,7 @@
'aTargets': [0], 'aTargets': [0],
"mData":"id", "mData":"id",
"mRender": function(a, b, c, d){ "mRender": function(a, b, c, d){
if (c.status == 4 || c.status == 3 || c.status == 2){ if ((c.status == 4 || c.status == 3 || c.status == 2) && c.confirm == null){
//是否超过7天 0标识超过7天 //是否超过7天 0标识超过7天
if( c.isExceedSevenDay == '0'){ if( c.isExceedSevenDay == '0'){
if(isCheckedQyCode.indexOf(a+"")!=-1){ if(isCheckedQyCode.indexOf(a+"")!=-1){
...@@ -550,17 +553,17 @@ ...@@ -550,17 +553,17 @@
} }
} }
} }
// ,
// {
// "aTargets": [8],
// "mData": "openid",
// "mRender": function (a, b, c, d) {
// return a;
// }
// }
, ,
{ {
"aTargets": [8], "aTargets": [8],
"mData": "openid",
"mRender": function (a, b, c, d) {
return a;
}
}
,
{
"aTargets": [9],
"mData": "courierNumber", "mData": "courierNumber",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -568,7 +571,7 @@ ...@@ -568,7 +571,7 @@
} }
, ,
{ {
"aTargets": [10], "aTargets": [9],
"mData": "status", "mData": "status",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
if (a == '0') { if (a == '0') {
...@@ -586,16 +589,16 @@ ...@@ -586,16 +589,16 @@
} }
} }
}, },
// {
// "aTargets": [11],
// "mData": "tradeNo",
// "mRender": function (a, b, c, d) {
// return a;
// }
// }
// ,
{ {
"aTargets": [11], "aTargets": [10],
"mData": "tradeNo",
"mRender": function (a, b, c, d) {
return a;
}
}
,
{
"aTargets": [12],
"mData": "confirm", "mData": "confirm",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a == null ? '否':'是'; return a == null ? '否':'是';
...@@ -603,7 +606,7 @@ ...@@ -603,7 +606,7 @@
} }
, ,
{ {
"aTargets": [13], "aTargets": [11],
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
let time = formatDates(a); let time = formatDates(a);
...@@ -615,7 +618,7 @@ ...@@ -615,7 +618,7 @@
} }
, ,
{ {
"aTargets": [14], "aTargets": [12],
"mData": "orderTime", "mData": "orderTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
let time = formatDates(a); let time = formatDates(a);
...@@ -627,7 +630,7 @@ ...@@ -627,7 +630,7 @@
} }
, ,
{ {
"aTargets": [15], "aTargets": [13],
"mData": "payTime", "mData": "payTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
let time = formatDates(a); let time = formatDates(a);
...@@ -639,7 +642,7 @@ ...@@ -639,7 +642,7 @@
} }
, ,
{ {
"aTargets": [16], "aTargets": [14],
"mData": "sendExpressDateStr", "mData": "sendExpressDateStr",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -647,7 +650,7 @@ ...@@ -647,7 +650,7 @@
} }
, ,
{ {
"aTargets": [17], "aTargets": [15],
"mData": "acceptExpressDateStr", "mData": "acceptExpressDateStr",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; return a;
...@@ -655,7 +658,7 @@ ...@@ -655,7 +658,7 @@
} }
, ,
{ {
"aTargets": [18], "aTargets": [16],
"mData": "cancelTime", "mData": "cancelTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
let time = formatDates(a); let time = formatDates(a);
...@@ -667,7 +670,7 @@ ...@@ -667,7 +670,7 @@
} }
, ,
{ {
"aTargets": [19], "aTargets": [17],
"mData": "id", "mData": "id",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
var html = '#if($shiro.hasPermission("qy:order:edit"))'; var html = '#if($shiro.hasPermission("qy:order:edit"))';
...@@ -680,7 +683,7 @@ ...@@ -680,7 +683,7 @@
'<ul class="dropdown-menu" role="menu" style="min-width: 100px;">\n'; '<ul class="dropdown-menu" role="menu" style="min-width: 100px;">\n';
html += '<li><a href="#springUrl("/a/order/findorderDetail?id=' + a + '&isDetail=y")">查看清单明细</a></li>'; html += '<li><a href="#springUrl("/a/order/findorderDetail?id=' + a + '&isDetail=y")">查看清单明细</a></li>';
if (c.status == '0') { if (c.status == '0') {
html += '<li><a href="#springUrl("/a/order/form?pageType=Edit&id=' + a + '")">添加商品</a></li>'; html += '<li><a href="#springUrl("/a/order/form?pageType=Edit&id=' + a + '")">订单确认</a></li>';
} }
if (c.status != '0') { if (c.status != '0') {
html += '<li><a href="#springUrl("/a/order/form?pageType=View&id=' + a + '")">查看详情</a></li>'; html += '<li><a href="#springUrl("/a/order/form?pageType=View&id=' + a + '")">查看详情</a></li>';
......
...@@ -34,5 +34,10 @@ ...@@ -34,5 +34,10 @@
<version>1.0-SNAPSHOT</version> <version>1.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>com.cftech</groupId>
<artifactId>logistics-module</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
\ No newline at end of file
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
o.order_cancel, o.order_cancel,
o.trade_no, o.trade_no,
o.description, o.description,
o.STATUS, o.status,
o.create_time, o.create_time,
o.update_time, o.update_time,
o.confirm, o.confirm,
...@@ -159,13 +159,12 @@ ...@@ -159,13 +159,12 @@
o.order_cancel AS orderCancel, o.order_cancel AS orderCancel,
o.trade_no AS tradeNo, o.trade_no AS tradeNo,
o.description, o.description,
o.STATUS, o.status,
o.create_time AS createTime, o.create_time AS createTime,
o.confirm, o.confirm,
o.courier_number AS courierNumber, o.courier_number AS courierNumber,
o.address_des, o.address_des AS addressDes,
o.openid, o.openid,
o.status,
o.remarks o.remarks
</sql> </sql>
......
...@@ -14,26 +14,30 @@ import java.util.Date; ...@@ -14,26 +14,30 @@ import java.util.Date;
public class OrderFromVO { public class OrderFromVO {
private Long id; private Long id;
private String consultId;
private String number; private String number;
private String courierNumber; private String courierNumber;
private String productNumber; private String productNumber;
private String productName; private String productName;
private Long productId; private Long productId;
private Long drugsNum; private Long drugsNum;
private double orderAmount; private String orderAmount;
private String address; private String address;
private String payStatus; private String payStatus;
private String description; private String description;
private String tradeNo; private String tradeNo;
@JSONField(format = "yyyy-MM-dd HH:mm:ss") @JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;
private Long confirm; private String confirm;
private String orderCancel; private String orderCancel;
private Double price; private String price;
private Double amount; private String amount;
private String openid; private String openid;
private String status; private String status;
private String remarks; private String remarks;
private String payUrl; private String payUrl;
private String payAmount;
private String addressDes;
} }
...@@ -109,9 +109,17 @@ public interface OrderService extends GenericService<Order> { ...@@ -109,9 +109,17 @@ public interface OrderService extends GenericService<Order> {
String findOrderPayParams(String orderId, String openId, String appId, String prepayId); String findOrderPayParams(String orderId, String openId, String appId, String prepayId);
/** /**
* 发送 * 发送微信消息
* @param id * @param id
* @return * @return
*/ */
boolean sendQyWechatMassage(Long id); boolean sendQyWechatMassage(Long id);
/**
* 获取路由信息
* @param appId
* @param orderCode
* @return
*/
JSONObject findRouteDetails(String appId, String orderCode);
} }
...@@ -10,6 +10,7 @@ import com.cftech.base.codingrule.utils.CodingruleUtils; ...@@ -10,6 +10,7 @@ import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.base.org.api.QyMsgUtil; import com.cftech.base.org.api.QyMsgUtil;
import com.cftech.base.org.model.Qyuser; import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.QyuserService; import com.cftech.base.org.service.QyuserService;
import com.cftech.core.scope.OrderType;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
import com.cftech.core.util.Constants; import com.cftech.core.util.Constants;
import com.cftech.core.util.DateFormatUtils; import com.cftech.core.util.DateFormatUtils;
...@@ -18,6 +19,8 @@ import com.cftech.core.util.SystemConfig; ...@@ -18,6 +19,8 @@ import com.cftech.core.util.SystemConfig;
import com.cftech.invoice.model.Invoice; import com.cftech.invoice.model.Invoice;
import com.cftech.invoice.model.InvoiceDto; import com.cftech.invoice.model.InvoiceDto;
import com.cftech.invoice.service.InvoiceService; import com.cftech.invoice.service.InvoiceService;
import com.cftech.logistics.model.Logistics;
import com.cftech.logistics.service.LogisticsService;
import com.cftech.mp.fans.model.MpFanssEntity; import com.cftech.mp.fans.model.MpFanssEntity;
import com.cftech.mp.fans.service.MpFanssService; import com.cftech.mp.fans.service.MpFanssService;
import com.cftech.order.model.*; import com.cftech.order.model.*;
...@@ -29,6 +32,8 @@ import com.cftech.core.generic.GenericServiceImpl; ...@@ -29,6 +32,8 @@ import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.order.utils.InvoiceUtil; import com.cftech.order.utils.InvoiceUtil;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TreeTableColumn;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
...@@ -63,6 +68,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -63,6 +68,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
@Autowired @Autowired
private InvoiceService invoiceService; private InvoiceService invoiceService;
@Autowired
private LogisticsService logisticsService;
@Autowired @Autowired
private CodingruleUtils codingruleUtils; private CodingruleUtils codingruleUtils;
...@@ -344,8 +352,8 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -344,8 +352,8 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
if (StringUtils.isNotBlank(invoiceDto.getAppId())){ if (StringUtils.isNotBlank(invoiceDto.getAppId())){
mpAccountsEntity = mpAccountsService.getMpAccountsAppid(invoiceDto.getAppId()); mpAccountsEntity = mpAccountsService.getMpAccountsAppid(invoiceDto.getAppId());
}else{ }else{
jsonObject.put("errorNo","2"); jsonObject.put("errorNo", "2");
jsonObject.put("errorMsg","appId不能为空"); jsonObject.put("errorMsg", "appId不能为空");
return jsonObject; return jsonObject;
} }
...@@ -365,9 +373,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -365,9 +373,9 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
unitTax = invoiceDto.getUnitTaxNumber(); unitTax = invoiceDto.getUnitTaxNumber();
} }
String str = invoiceUtil.startInvoice(order,order.getNickName(),invoiceDto.getEmail(),invoiceDto.getType(),"0",unitTax); String str = invoiceUtil.startInvoice(order,order.getNickName(), invoiceDto.getEmail(), invoiceDto.getType(), "0", unitTax);
JSONObject json = JSON.parseObject(str); JSONObject json = JSON.parseObject(str);
if ( org.apache.commons.lang3.StringUtils.isNotBlank(json.getString("code")) && json.getString("code").equals("E0000")){ if (StringUtils.isNotBlank(json.getString("code")) && json.getString("code").equals("E0000")){
//开票成功 添加一条开票记录 //开票成功 添加一条开票记录
//流水号 //流水号
String invoiceSerialNum = json.getJSONObject("result").getString("invoiceSerialNum"); String invoiceSerialNum = json.getJSONObject("result").getString("invoiceSerialNum");
...@@ -381,12 +389,11 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -381,12 +389,11 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
invoice.setInvoiceTitle(invoiceDto.getInvoiceTitle()); invoice.setInvoiceTitle(invoiceDto.getInvoiceTitle());
invoice.setInvoiceContent(invoiceDto.getInvoiceContent()); invoice.setInvoiceContent(invoiceDto.getInvoiceContent());
invoice.setInvoiceType("1"); invoice.setInvoiceType("1");
invoice.setInvoiceForm("1"); invoice.setInvoiceForm("0");
invoice.setClerkId(order.getMemberName()); invoice.setClerkId(order.getMemberName());
invoice.setOrderId(order.getNumber()); invoice.setOrderId(order.getNumber());
invoice.setPushMode("0"); invoice.setPushMode("0");
invoice.setEmail(invoiceDto.getEmail()); invoice.setEmail(invoiceDto.getEmail());
invoice.setStatus("0");
invoice.setInvoiceSerialNum(invoiceSerialNum); invoice.setInvoiceSerialNum(invoiceSerialNum);
invoice.setAccountsId(mpAccountsEntity.getId()); invoice.setAccountsId(mpAccountsEntity.getId());
invoice.setOpenId(order.getOpenid()); invoice.setOpenId(order.getOpenid());
...@@ -398,7 +405,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -398,7 +405,7 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
orderMapper.update(order); orderMapper.update(order);
}else{ }else{
jsonObject.put("errorNo", 1); jsonObject.put("errorNo", 1);
jsonObject.put("errorMsg", org.apache.commons.lang3.StringUtils.isEmpty(json.getString("describe")) ? json.getString("message") : json.getString("describe")); jsonObject.put("errorMsg", StringUtils.isNotBlank(json.getString("describe")) ? json.getString("describe") : json.getString("describe"));
return jsonObject; return jsonObject;
} }
} }
...@@ -561,4 +568,28 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order ...@@ -561,4 +568,28 @@ public class OrderServiceImpl extends GenericServiceImpl<Order> implements Order
return true; return true;
} }
@Override
public JSONObject findRouteDetails(String appId, String orderCode) {
JSONObject retObj = new JSONObject();
if (StringUtils.isBlank(orderCode)) {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "RequestParams Is Null! ");
return retObj;
}
Conds conds = new Conds();
conds.equal("del_flag", Constants.DEL_FLAG_0);
conds.equal("order_no", orderCode);
Sort sort = new Sort("accept_time", OrderType.DESC);
List<Logistics> logistics = logisticsService.fetchSearchByPage(conds, sort, 0, 0);
if (logistics != null && logistics.size() > 0) {
retObj.put("errorNo", 0);
retObj.put("data", logistics);
} else {
retObj.put("errorNo", 1);
retObj.put("errorMsg", "RequestParams Is Null! ");
}
return retObj;
}
} }
\ No newline at end of file
...@@ -25,6 +25,7 @@ import java.util.List; ...@@ -25,6 +25,7 @@ import java.util.List;
@CrossOrigin @CrossOrigin
@RequestMapping("mobile/auth/order") @RequestMapping("mobile/auth/order")
public class MobileOrderController { public class MobileOrderController {
@Autowired @Autowired
private OrderService orderService; private OrderService orderService;
...@@ -85,6 +86,14 @@ public class MobileOrderController { ...@@ -85,6 +86,14 @@ public class MobileOrderController {
return orderService.callBackPayStatus(request); return orderService.callBackPayStatus(request);
} }
/**
* 获取微信付款加密参数
* @param orderId
* @param openId
* @param appId
* @param prepayId
* @return
*/
@RequestMapping(value = "/findOrderPayParams", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) @RequestMapping(value = "/findOrderPayParams", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public String findOrderPayParams(@RequestParam String orderId, public String findOrderPayParams(@RequestParam String orderId,
@RequestParam String openId, @RequestParam String openId,
...@@ -93,4 +102,16 @@ public class MobileOrderController { ...@@ -93,4 +102,16 @@ public class MobileOrderController {
return orderService.findOrderPayParams(orderId, openId, appId, prepayId); return orderService.findOrderPayParams(orderId, openId, appId, prepayId);
} }
/**
* 获取路由信息
* @param appId
* @param orderCode
* @return
*/
@RequestMapping(value = "/findRouteDetails", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public JSONObject findRouteDetails(@RequestParam String appId,
@RequestParam String orderCode) {
return orderService.findRouteDetails(appId, orderCode);
}
} }
...@@ -266,17 +266,16 @@ public class OrderController { ...@@ -266,17 +266,16 @@ public class OrderController {
Sort sort = new Sort("o.create_time", OrderType.DESC); Sort sort = new Sort("o.create_time", OrderType.DESC);
List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid); List<Order> list = orderService.fetchSearchBy(conds, sort, iDisplayStart, iDisplayLength, userid);
//设置是否可以开票
Date today = new Date(); Date today = new Date();
int i = 0; int longNum = 0;
for (Order obj : list){ for (Order obj : list){
if((obj.getStatus().equals("4") || obj.getStatus().equals("3") || obj.getStatus().equals("2")) && StringUtils.isBlank(obj.getConfirm()) && obj.getPayTime() != null){ // if (obj.getPayTime() != null && StringUtils.isBlank(obj.getConfirm())) {
i = (int)(today.getTime()-obj.getPayTime().getTime()) / (1000*3600*24); // longNum = (int)(today.getTime()-obj.getPayTime().getTime()) / (1000*3600*24);
if(i >= 7){ // if(longNum >= 7){
obj.setIsExceedSevenDay("0"); obj.setIsExceedSevenDay("0");
}else { // }
obj.setIsExceedSevenDay("1"); // }
}
}
} }
Integer counts = orderService.count(conds, userid); Integer counts = orderService.count(conds, userid);
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
...@@ -296,7 +295,7 @@ public class OrderController { ...@@ -296,7 +295,7 @@ public class OrderController {
Long accountsId = UserUtils.getmpaccounts(request); Long accountsId = UserUtils.getmpaccounts(request);
try { try {
Conds conds = new Conds(); Conds conds = new Conds();
conds.in("o.id",id.split(",")); conds.in("o.id", id.split(","));
conds.equal("o.del_flag", Constants.DEL_FLAG_0); conds.equal("o.del_flag", Constants.DEL_FLAG_0);
conds.equal("o.accounts_id", accountsId); conds.equal("o.accounts_id", accountsId);
List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, userid); List<Order> list = orderService.fetchSearchBy(conds, null, 0, 0, userid);
...@@ -304,9 +303,9 @@ public class OrderController { ...@@ -304,9 +303,9 @@ public class OrderController {
for (Order order : list){ for (Order order : list){
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
order.setCreateTimeStr(format.format(order.getCreateTime())); order.setCreateTimeStr(format.format(order.getCreateTime()));
String str = invoiceUtil.startInvoice(order,String.valueOf(userid),email,"0","1",null); String str = invoiceUtil.startInvoice(order, String.valueOf(userid), email,"0","1",null);
JSONObject json = JSON.parseObject(str); JSONObject json = JSON.parseObject(str);
if ( StringUtils.isNotBlank(json.getString("code")) && json.getString("code").equals("E0000")){ if (StringUtils.isNotBlank(json.getString("code")) && json.getString("code").equals("E0000")){
//开票成功 添加一条开票记录 //开票成功 添加一条开票记录
//流水号 //流水号
String invoiceSerialNum = json.getJSONObject("result").getString("invoiceSerialNum"); String invoiceSerialNum = json.getJSONObject("result").getString("invoiceSerialNum");
...@@ -318,10 +317,9 @@ public class OrderController { ...@@ -318,10 +317,9 @@ public class OrderController {
invoice.setInvoiceType("1"); invoice.setInvoiceType("1");
invoice.setInvoiceForm("1"); invoice.setInvoiceForm("1");
invoice.setClerkId(SystemConfig.p.getProperty("CLERK")); invoice.setClerkId(SystemConfig.p.getProperty("CLERK"));
invoice.setOrderId(order.getNumber()); invoice.setOrderId(order.getNickName());
invoice.setPushMode("0"); invoice.setPushMode("0");
invoice.setEmail(email); invoice.setEmail(email);
invoice.setStatus("0");
invoice.setInvoiceSerialNum(invoiceSerialNum); invoice.setInvoiceSerialNum(invoiceSerialNum);
invoice.setAccountsId(accountsId); invoice.setAccountsId(accountsId);
invoice.setOpenId(order.getOpenid()); invoice.setOpenId(order.getOpenid());
......
...@@ -270,7 +270,15 @@ ...@@ -270,7 +270,15 @@
} }
}, },
{ {
"mData": "storageManageName" "mData": "storageManageName",
"mRender": function (a, b, c, d) {
console.log(a);
if (c.storageManage == '1') {
return 'admin';
} else {
return a;
}
}
}, },
{ {
"mData": "filterResult", "mData": "filterResult",
......
...@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray; ...@@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.cftech.accounts.model.SysJob; import com.cftech.accounts.model.SysJob;
import com.cftech.accounts.service.JobService; import com.cftech.accounts.service.JobService;
import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.util.Constants; import com.cftech.core.util.Constants;
import com.cftech.core.util.SpringContextHolder; import com.cftech.core.util.SpringContextHolder;
...@@ -11,6 +13,12 @@ import com.cftech.core.util.StringUtils; ...@@ -11,6 +13,12 @@ import com.cftech.core.util.StringUtils;
import com.cftech.core.util.SystemConfig; import com.cftech.core.util.SystemConfig;
import com.cftech.logistics.model.Logistics; import com.cftech.logistics.model.Logistics;
import com.cftech.logistics.service.LogisticsService; import com.cftech.logistics.service.LogisticsService;
import com.cftech.member.model.Member;
import com.cftech.member.service.MemberService;
import com.cftech.mp.fans.model.MpFanssEntity;
import com.cftech.mp.fans.service.MpFanssService;
import com.cftech.order.model.Order;
import com.cftech.order.service.OrderService;
import com.cftech.waybill.model.Waybill; import com.cftech.waybill.model.Waybill;
import com.cftech.waybill.service.WaybillService; import com.cftech.waybill.service.WaybillService;
import com.cftech.waybill.utils.CloseableHttpEntity; import com.cftech.waybill.utils.CloseableHttpEntity;
...@@ -69,6 +77,14 @@ public class WaybillRouterJob implements Job { ...@@ -69,6 +77,14 @@ public class WaybillRouterJob implements Job {
WaybillService waybillService = SpringContextHolder.getBean(WaybillService.class); WaybillService waybillService = SpringContextHolder.getBean(WaybillService.class);
LogisticsService logisticsService = SpringContextHolder.getBean(LogisticsService.class); LogisticsService logisticsService = SpringContextHolder.getBean(LogisticsService.class);
OrderService orderService = SpringContextHolder.getBean(OrderService.class);
MpAccountsService mpAccountsService = SpringContextHolder.getBean(MpAccountsService.class);
MemberService memberService = SpringContextHolder.getBean(MemberService.class);
MpFanssService fanssService = SpringContextHolder.getBean(MpFanssService.class);
CodingruleUtils codingruleUtils = SpringContextHolder.getBean(CodingruleUtils.class);
String appId = SystemConfig.p.getProperty("WX_MP_SERVER_APPID");
Long accoountId = mpAccountsService.getMpAccountsAppid(appId).getId();
Conds conds = new Conds(); Conds conds = new Conds();
conds.isNull("t.accept_express_date"); conds.isNull("t.accept_express_date");
...@@ -95,7 +111,7 @@ public class WaybillRouterJob implements Job { ...@@ -95,7 +111,7 @@ public class WaybillRouterJob implements Job {
StringUtils.equals(closeableHttpEntity.getRetObj().getString("apiResultCode"), "A1000")) { StringUtils.equals(closeableHttpEntity.getRetObj().getString("apiResultCode"), "A1000")) {
JSONObject result = closeableHttpEntity.getRetObj().getJSONObject("apiResultData"); JSONObject result = closeableHttpEntity.getRetObj().getJSONObject("apiResultData");
if (result.getBoolean("success") && StringUtils.equals("errorCode", "S0000")) { if (result.getBoolean("success") && StringUtils.equals(result.getString("errorCode"), "S0000")) {
JSONObject msgData = result.getJSONObject("msgData"); JSONObject msgData = result.getJSONObject("msgData");
JSONArray routeResps = msgData.getJSONArray("routeResps"); JSONArray routeResps = msgData.getJSONArray("routeResps");
for (int i = 0; i<routeResps.size(); i++) { for (int i = 0; i<routeResps.size(); i++) {
...@@ -105,29 +121,59 @@ public class WaybillRouterJob implements Job { ...@@ -105,29 +121,59 @@ public class WaybillRouterJob implements Job {
for (int y=0; y<routes.size(); y++) { for (int y=0; y<routes.size(); y++) {
JSONObject routObj = routes.getJSONObject(y); JSONObject routObj = routes.getJSONObject(y);
Conds routConds = new Conds(); Conds routConds = new Conds();
routConds.equal("mail_no", mailNo);
routConds.equal("del_flag", Constants.DEL_FLAG_0); routConds.equal("del_flag", Constants.DEL_FLAG_0);
routConds.equal("opcode", routObj.getString("opcode")); routConds.equal("opcode", routObj.getString("opCode"));
routConds.equal("mail_no", waybill.getNumber()); routConds.equal("number", routObj.getString("remark"));
Logistics logistics =logisticsService.fetchSearchByConds(routConds); Logistics logistics = logisticsService.fetchSearchByConds(routConds);
if (logistics == null) { if (logistics == null) {
logistics = new Logistics(); logistics = new Logistics();
logistics.setMailNo(waybill.getNumber()); logistics.setAccountsId(accoountId);
logistics.setMailNo(mailNo);
logistics.setOrderNo(waybill.getOrderCode()); logistics.setOrderNo(waybill.getOrderCode());
logistics.setAcceptTime(routObj.getDate("acceptTime")); logistics.setAcceptTime(routObj.getDate("acceptTime"));
logistics.setAcceptAddress(routObj.getString("acceptAddress")); logistics.setAcceptAddress(routObj.getString("acceptAddress"));
logistics.setNumber(routObj.getString("remark")); logistics.setNumber(routObj.getString("remark"));
logistics.setOpcode(routObj.getString("opcode")); logistics.setOpcode(routObj.getString("opCode"));
logisticsService.save(logistics); logisticsService.save(logistics);
}
if (StringUtils.equals(routObj.getString("opcode"), "50")) { //订单收件
if (StringUtils.equals(routObj.getString("opCode"), "50")) {
waybill.setSendExpressDate(routObj.getDate("acceptTime")); waybill.setSendExpressDate(routObj.getDate("acceptTime"));
waybillService.update(waybill); waybillService.update(waybill);
} }
if (StringUtils.equals(routObj.getString("opcode"), "80")) { //订单签收
if (StringUtils.equals(routObj.getString("opCode"), "80")) {
waybill.setAcceptExpressDate(routObj.getDate("acceptTime")); waybill.setAcceptExpressDate(routObj.getDate("acceptTime"));
waybillService.update(waybill); waybillService.update(waybill);
//回写订单已完成状态
Conds orderConds = new Conds();
orderConds.equal("o.del_flag", Constants.DEL_FLAG_0);
orderConds.equal("o.id", waybill.getOrderId());
Order order = orderService.fetchSearchByConds(orderConds);
if (order != null) {
order.setStatus("4");
orderService.update(order);
}
Conds memberConds = new Conds();
memberConds.equal("del_flag", Constants.DEL_FLAG_0);
memberConds.equal("open_id", order.getOpenid());
Member member = memberService.fetchSearchByConds(memberConds);
if (member == null) {
MpFanssEntity fanssEntity = fanssService.getWxUser(order.getOpenid());
//生成会员数据
member = new Member();
member.setNumber(codingruleUtils.getNumber(fanssEntity.getMpaccountid(), Member.class.getName()));
member.setName(fanssEntity.getNickname());
member.setImageurl(fanssEntity.getHeadimgurl());
member.setSex(Long.parseLong(fanssEntity.getSex()));
memberService.save(member);
}
}
} }
} }
} }
......
...@@ -29,6 +29,7 @@ public class BillPrinterUtils { ...@@ -29,6 +29,7 @@ public class BillPrinterUtils {
* @return * @return
*/ */
public static boolean executePrinter(String printStr) { public static boolean executePrinter(String printStr) {
System.out.print(printStr);
String link = FqConstants.TWO_UNITED_150; String link = FqConstants.TWO_UNITED_150;
try { try {
link = isPrinterLogo(link, true); link = isPrinterLogo(link, true);
...@@ -45,7 +46,7 @@ public class BillPrinterUtils { ...@@ -45,7 +46,7 @@ public class BillPrinterUtils {
connection.setReadTimeout(3 * 5000); connection.setReadTimeout(3 * 5000);
connection.getOutputStream().write(printStr.getBytes()); connection.getOutputStream().write(printStr.getBytes("utf-8"));
connection.getOutputStream().flush(); connection.getOutputStream().flush();
connection.getOutputStream().close(); connection.getOutputStream().close();
......
...@@ -65,15 +65,13 @@ public class ExpressOrderInfoUtils { ...@@ -65,15 +65,13 @@ public class ExpressOrderInfoUtils {
billPrinter.put("consignerMobile", waybillObj.getMobile()); billPrinter.put("consignerMobile", waybillObj.getMobile());
billPrinter.put("consignerProvince", waybillObj.getProvince()); billPrinter.put("consignerProvince", waybillObj.getProvince());
billPrinter.put("consignerCity", waybillObj.getCity()); billPrinter.put("consignerCity", waybillObj.getCity());
if (StringUtils.isNoneBlank(waybillObj.getCounty()) && waybillObj.getCounty().length() >= 2) { billPrinter.put("consignerCounty", waybillObj.getCounty());
StringBuilder county = new StringBuilder(waybillObj.getCounty());
billPrinter.put("consignerCounty", county.replace(1, 2, "*"));
} else {
billPrinter.put("consignerCounty", "");
}
if (StringUtils.isNoneBlank(waybillObj.getAddress()) && waybillObj.getAddress().length() >= 2) { if (StringUtils.isNoneBlank(waybillObj.getAddress()) && waybillObj.getAddress().length() >= 2) {
StringBuilder address = new StringBuilder(waybillObj.getAddress()); StringBuilder address = new StringBuilder(waybillObj.getAddress());
billPrinter.put("consignerAddress", address.replace(0, 2, "*")); String tips = "";
for (int i=0; i<address.length(); i++) {tips += "*";}
billPrinter.put("consignerAddress", address.replace(0, address.length(), tips));
} else { } else {
billPrinter.put("consignerAddress", ""); billPrinter.put("consignerAddress", "");
} }
...@@ -89,7 +87,7 @@ public class ExpressOrderInfoUtils { ...@@ -89,7 +87,7 @@ public class ExpressOrderInfoUtils {
JSONArray cargoInfoDtoList = new JSONArray(); JSONArray cargoInfoDtoList = new JSONArray();
for (OrderDetails ord: orderDetails) { for (OrderDetails ord: orderDetails) {
JSONObject cargoInfo = new JSONObject(); JSONObject cargoInfo = new JSONObject();
cargoInfo.put("cargo", ord.getProductName()); cargoInfo.put("cargo", ord.getCommonName());
cargoInfo.put("cargoCount", ord.getDrugsNum()); cargoInfo.put("cargoCount", ord.getDrugsNum());
cargoInfo.put("cargoUnit", "盒"); cargoInfo.put("cargoUnit", "盒");
cargoInfo.put("remark", "医药物品,请小心轻放!"); cargoInfo.put("remark", "医药物品,请小心轻放!");
...@@ -273,6 +271,8 @@ public class ExpressOrderInfoUtils { ...@@ -273,6 +271,8 @@ public class ExpressOrderInfoUtils {
retObj.put("trackingType", 1);//1:根据顺丰运单号查询 retObj.put("trackingType", 1);//1:根据顺丰运单号查询
JSONArray waybills = new JSONArray(); JSONArray waybills = new JSONArray();
waybills.add(waybillObj.getWaybillNo());
retObj.put("trackingNumber", waybills);//顺丰运单号 retObj.put("trackingNumber", waybills);//顺丰运单号
retObj.put("methodType", 1);//标准路由查询 retObj.put("methodType", 1);//标准路由查询
} catch (Exception e) { } catch (Exception e) {
......
...@@ -10,14 +10,14 @@ public class FqConstants { ...@@ -10,14 +10,14 @@ public class FqConstants {
* url: 请求地址 * url: 请求地址
* code: 接口服务代码 * code: 接口服务代码
*/ */
public static final String SF_ORDER_SEND_URL = "https://sfapi-sbox.sf-express.com/std/service"; public static final String SF_ORDER_SEND_URL = "https://sfapi.sf-express.com/std/service";
public static final String SF_ORDER_SEND_CODE = "EXP_RECE_CREATE_ORDER"; public static final String SF_ORDER_SEND_CODE = "EXP_RECE_CREATE_ORDER";
/** /**
* 丰桥API:订单查询接口URL * 丰桥API:订单查询接口URL
* code: 接口服务代码 * code: 接口服务代码
*/ */
public static final String SF_ORDER_SEARCH_URL = "https://sfapi-sbox.sf-express.com/std/service"; public static final String SF_ORDER_SEARCH_URL = "https://sfapi.sf-express.com/std/service";
public static final String SF_ORDER_SEARCH_CODE = "EXP_RECE_SEARCH_ORDER_RESP"; public static final String SF_ORDER_SEARCH_CODE = "EXP_RECE_SEARCH_ORDER_RESP";
/** /**
...@@ -32,7 +32,7 @@ public class FqConstants { ...@@ -32,7 +32,7 @@ public class FqConstants {
* 丰桥API:订单路由接口URL * 丰桥API:订单路由接口URL
* code: 接口服务代码 * code: 接口服务代码
*/ */
public static final String SF_ORDER_ROUTE_URL = "https://sfapi-sbox.sf-express.com/std/service"; public static final String SF_ORDER_ROUTE_URL = "https://sfapi.sf-express.com/std/service";
public static final String SF_ORDER_ROUTE_CODE = "EXP_RECE_SEARCH_ROUTES"; public static final String SF_ORDER_ROUTE_CODE = "EXP_RECE_SEARCH_ROUTES";
/** /**
......
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
if (a == '1') { if (a == '1') {
return '药师二维码'; return '药师二维码';
} else if (a == '2') { } else if (a == '2') {
return '客服二码'; return '客服二码';
}else if(a == '3'){ }else if(a == '3'){
return '医生二维码'; return '医生二维码';
}else if(a == "4"){ }else if(a == "4"){
......
...@@ -150,15 +150,15 @@ ...@@ -150,15 +150,15 @@
q.`name`, q.`name`,
o.org_name, o.org_name,
CASE CASE
WHEN t.type = '0' OR t.type = '1' OR t.type = '2' THEN WHEN t.type = '1' OR t.type = '2' OR t.type = '3' THEN
q.`name` q.`name`
WHEN t.type = '3' THEN WHEN t.type = '4' THEN
o.org_name ELSE '' o.org_name ELSE ''
END qrcodeNames END qrcodeNames
FROM FROM
t_shop_wxqrcode t t_shop_wxqrcode t
LEFT JOIN t_qyuser q ON q.id = t.bind_id LEFT JOIN t_qyuser q ON q.id = t.bind_id
LEFT JOIN t_orgunit o ON o.id = t.bind_id AND t.type='3' LEFT JOIN t_orgunit o ON o.id = t.bind_id AND t.type = '4'
<include refid="sqlWhere"/> <include refid="sqlWhere"/>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
......
##JDBC Global Setting ##JDBC Global Setting
#\u5916\u7F51
jdbc.driver=com.mysql.jdbc.Driver jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://172.18.10.40:3306/aidea_wechat?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true jdbc.url=jdbc:mysql://58.220.99.124:3306/aidea_wechat?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
jdbc.username=root jdbc.username=root
jdbc.password=Aidea@2017 jdbc.password=Aidea@2017
#jdbc.url=jdbc:mysql://120.195.144.73:3306/cfwechat?useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true #\u5185\u7F51
#jdbc.url=jdbc:mysql://172.18.10.40:3306/aidea_wechat?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
#jdbc.username=root #jdbc.username=root
#jdbc.password=cf123456 #jdbc.password=Aidea@2017
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<bean id="convertPwdPropertyConfigurer" class="com.cftech.core.util.ConvertPwdPropertyConfigurer"> <bean id="convertPwdPropertyConfigurer" class="com.cftech.core.util.ConvertPwdPropertyConfigurer">
<property name="locations"> <property name="locations">
<list> <list>
<value>classpath*:application-test.properties</value> <value>classpath*:application.properties</value>
</list> </list>
</property> </property>
</bean> </bean>
......
...@@ -50,7 +50,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog ...@@ -50,7 +50,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY #\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
MEMBER_PASSWORD_KEY=DONGCHANGINT9527; MEMBER_PASSWORD_KEY=DONGCHANGINT9527;
list.refreshtoken=true list.refreshtoken=true
jwt.domain=localhost jwt.domain=pd.shxrtech.com
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD #\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration=86400000 jwt.duration=86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue #\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
...@@ -58,7 +58,7 @@ security.secure=false ...@@ -58,7 +58,7 @@ security.secure=false
#\u662F\u5426\u96C6\u7FA4 master\u4E3Atrue #\u662F\u5426\u96C6\u7FA4 master\u4E3Atrue
quartz.isCluster=true quartz.isCluster=true
#\u987A\u4E30API\u914D\u7F6E\u53C2\u6570 #\u987A\u4E30\u7269\u6D41\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
#\u987A\u4E30\u5BA2\u6237\u7F16\u7801 #\u987A\u4E30\u5BA2\u6237\u7F16\u7801
sf.partnerID=NKDYFr sf.partnerID=NKDYFr
#\u987A\u4E30\u5BA2\u6237\u6821\u9A8C\u7801 #\u987A\u4E30\u5BA2\u6237\u6821\u9A8C\u7801
...@@ -66,7 +66,7 @@ sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd ...@@ -66,7 +66,7 @@ sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd
#\u987A\u4E30\u6708\u7ED3\u5361\u53F7 #\u987A\u4E30\u6708\u7ED3\u5361\u53F7
sf.monthlyCard=7551234567 sf.monthlyCard=7551234567
#INVOICE #\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
INVOICE_TOKEN=4d02142a23eece11a0407f0sghefntms INVOICE_TOKEN=4d02142a23eece11a0407f0sghefntms
SQ_INVOICE_TAX=91321000MA22HQQ953 SQ_INVOICE_TAX=91321000MA22HQQ953
INVOICE_TAX=339901999999824 INVOICE_TAX=339901999999824
...@@ -83,7 +83,7 @@ INVOICE_URL=https://sandbox.nuonuocs.cn/open/v1/services ...@@ -83,7 +83,7 @@ INVOICE_URL=https://sandbox.nuonuocs.cn/open/v1/services
REGION_LONG_ID=0,1,5, REGION_LONG_ID=0,1,5,
#\u5546\u6237\u53F7\u914D\u7F6E\u6587\u4EF6 #\u5546\u6237\u53F7\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
mch.mch_id=1604243615 mch.mch_id=1604243615
#\u7EC8\u7AEFid #\u7EC8\u7AEFid
mch.spbill_id=47.103.35.182 mch.spbill_id=47.103.35.182
......
...@@ -6,10 +6,10 @@ WX_MP_QRCODE_URI=https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket= ...@@ -6,10 +6,10 @@ WX_MP_QRCODE_URI=https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=
#\u670D\u52A1\u53F7\u6A21\u677F\u6D88\u606F ID LIST #\u670D\u52A1\u53F7\u6A21\u677F\u6D88\u606F ID LIST
#\u54A8\u8BE2\u5355\u5BA1\u6838\u901A\u8FC7\u6A21\u677F\u6D88\u606F #\u54A8\u8BE2\u5355\u5BA1\u6838\u901A\u8FC7\u6A21\u677F\u6D88\u606F
CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG=AoZzYGqvG5h5wDDDOE_fUrdMOam-QTqTc7wkBO7-VmU CONSULT_SHEET_AUDIT_SUCCESS_TEMPLATE_MSG=a7oZd-03JxbKKNup-q9p4vrR4h0a6pbiLMNCi69RdGU
#\u54A8\u8BE2\u5355\u5BA1\u6838\u62D2\u7EDD\u6A21\u677F\u6D88\u606F #\u54A8\u8BE2\u5355\u5BA1\u6838\u62D2\u7EDD\u6A21\u677F\u6D88\u606F
CONSULT_SHEET_AUDIT_REFUSE_TEMPLATE_MSG=VSTKsUB_vK8UaiaZplmgk4IvrqIAfIiRD54mUlGR0k0 CONSULT_SHEET_AUDIT_REFUSE_TEMPLATE_MSG=qJNaTk1KaSCha1LowafhVWS6y4rNBI5JxKP5Af9CPGQ
#\u54A8\u8BE2\u4F46\u5BA1\u6838\u5931\u8D25\u6A21\u677F\u6D88\u606F #\u54A8\u8BE2\u5355\u5BA1\u6838\u5931\u8D25\u6A21\u677F\u6D88\u606F
CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5UkHwk CONSULT_SHEET_AUDIT_FAILED_TEMPLATE_MSG=77tLdRPQx1m8Gg0-t9HCGVOlka0G4ocFPdq8D5UkHwk
#\u4F01\u4E1A\u53F7\u914D\u7F6E\u4FE1\u606F #\u4F01\u4E1A\u53F7\u914D\u7F6E\u4FE1\u606F
...@@ -50,7 +50,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog ...@@ -50,7 +50,7 @@ LOG_URL=http://www.michang-tech.com.cn:6989/log/addlog
#\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY #\u6821\u9A8C\u5151\u6362\u5BC6\u7801KEY
MEMBER_PASSWORD_KEY=DONGCHANGINT9527; MEMBER_PASSWORD_KEY=DONGCHANGINT9527;
list.refreshtoken=true list.refreshtoken=true
jwt.domain=pe.aidea.com.cn jwt.domain=localhost
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD #\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD
jwt.duration=86400000 jwt.duration=86400000
#\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue #\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u03AAtrue
...@@ -67,19 +67,24 @@ sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd ...@@ -67,19 +67,24 @@ sf.checkWord=ExAMu7ADrjDeUMJCKOAf45Ywgo2q12Sd
sf.monthlyCard=5141870609 sf.monthlyCard=5141870609
#\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570 #\u8BFA\u8BFA\u5F00\u7968\u914D\u7F6E\u4FE1\u606F\u53C2\u6570
INVOICE_TOKEN=4d02142a23eece11a0407f0sghefntms INVOICE_TOKEN=4d02142a23eece11a0407f0jge3cbk0s
SQ_INVOICE_TAX=91321000MA22HQQ953 #SQ_INVOICE_TAX=91321000MA22HQQ953
INVOICE_TAX=339901999999824 INVOICE_TAX=91321000MA22HQQ953
SALER_TEL=0514-82360278 SALER_TEL=0514-82360278
SALER_ADDRESS=\u626C\u5DDE\u5E02\u9097\u6C5F\u533A\u79D1\u6280\u56ED\u8DEF18\u53F7 SALER_ADDRESS=\u626C\u5DDE\u5E02\u9097\u6C5F\u533A\u79D1\u6280\u56ED\u8DEF18\u53F7
APP_KEY=SD76454598 APP_KEY=76454598
APP_SECRET=SD25624CC1DF4AB7 APP_SECRET=7625624CC1DF4AB7
KAIHUHANG_ADDRESS=\u6C5F\u82CF\u94F6\u884C\u626C\u5DDE\u5510\u57CE\u652F\u884C 90160188000128434 KAIHUHANG_ADDRESS=\u6C5F\u82CF\u94F6\u884C\u626C\u5DDE\u5510\u57CE\u652F\u884C 90160188000128434
CLERK=\u5415\u5029 CLERK=\u5415\u5029
CHECKER=\u7530\u59DD CHECKER=\u7530\u59DD
PAYEE=\u6C6A\u8A00\u52C7 PAYEE=\u6C6A\u8A00\u52C7
#\u5F00\u53D1\u7968\u63A5\u53E3
INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew INVOICE_API=nuonuo.ElectronInvoice.requestBillingNew
INVOICE_URL=https://sandbox.nuonuocs.cn/open/v1/services #\u67E5\u8BE2\u53D1\u7968\u63A5\u53E3
INVOICE_QUERY_API=nuonuo.ElectronInvoice.queryInvoiceResult
#\u90AE\u7BB1\u63A8\u9001\u63A5\u53E3
INVOICE_SEND_EMAIL_API=nuonuo.ElectronInvoice.deliveryInvoice
INVOICE_URL=https://sdk.nuonuo.com/open/vi/services
REGION_LONG_ID=0,1,5, REGION_LONG_ID=0,1,5,
......
...@@ -2,11 +2,13 @@ ...@@ -2,11 +2,13 @@
# Redis\uFFFD\uFFFD\uFFFD\u077F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u012C\uFFFD\uFFFD\u03AA0\uFFFD\uFFFD # Redis\uFFFD\uFFFD\uFFFD\u077F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u012C\uFFFD\uFFFD\u03AA0\uFFFD\uFFFD
spring.redis.database=10 spring.redis.database=10
# Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B7 # Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u05B7
spring.redis.host=172.18.10.44 spring.redis.host=58.220.99.124
# \u5185\u7F51Reids
#spring.redis.host=172.18.10.44
# Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u04F6\u02FF\uFFFD # Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u04F6\u02FF\uFFFD
spring.redis.port=6379 spring.redis.port=6379
# Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uB8E8\u012C\uFFFD\uFFFD\u03AA\uFFFD\u0563\uFFFD # Redis\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uB8E8\u012C\uFFFD\uFFFD\u03AA\uFFFD\u0563\uFFFD
spring.redis.password=Aidea@2017 spring.redis.password=OJpVPXowrqbtWtkdi3wt5A==
# \uFFFD\uFFFD\uFFFD\u04F3\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u02B9\uFFFD\u00F8\uFFFD\u05B5\uFFFD\uFFFD\u02BE\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u01A3\uFFFD # \uFFFD\uFFFD\uFFFD\u04F3\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u02B9\uFFFD\u00F8\uFFFD\u05B5\uFFFD\uFFFD\u02BE\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u01A3\uFFFD
spring.redis.pool.max-active=8 spring.redis.pool.max-active=8
# \uFFFD\uFFFD\uFFFD\u04F3\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0234\uFFFD\u02B1\uFFFD\u48E8\u02B9\uFFFD\u00F8\uFFFD\u05B5\uFFFD\uFFFD\u02BE\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u01A3\uFFFD # \uFFFD\uFFFD\uFFFD\u04F3\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0234\uFFFD\u02B1\uFFFD\u48E8\u02B9\uFFFD\u00F8\uFFFD\u05B5\uFFFD\uFFFD\u02BE\u00FB\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u01A3\uFFFD
......
...@@ -16,11 +16,11 @@ import java.security.SecureRandom; ...@@ -16,11 +16,11 @@ import java.security.SecureRandom;
* DES加密类 * DES加密类
*/ */
public class DESUtil { public class DESUtil {
public static final String KEY_ALGORITHM = "DES";
//算法名称/加密模式/填充方式
public static final String KEY = "schaffler@952710"; public static final String KEY = "schaffler@952710";
//算法名称 //算法名称
public static final String KEY_ALGORITHM = "DES";
//算法名称/加密模式/填充方式
//DES共有四种工作模式-->>ECB:电子密码本模式、CBC:加密分组链接模式、CFB:加密反馈模式、OFB:输出反馈模式 //DES共有四种工作模式-->>ECB:电子密码本模式、CBC:加密分组链接模式、CFB:加密反馈模式、OFB:输出反馈模式
public static final String CIPHER_ALGORITHM = "DES/ECB/PKCS5Padding"; public static final String CIPHER_ALGORITHM = "DES/ECB/PKCS5Padding";
...@@ -112,9 +112,9 @@ public class DESUtil { ...@@ -112,9 +112,9 @@ public class DESUtil {
// REDIS : changfu@123 ,数据库 mongodb root root, 正是环境sfl@2018 SQL数据库 55555abc // REDIS : changfu@123 ,数据库 mongodb root root, 正是环境sfl@2018 SQL数据库 55555abc
System.out.println(0x1); System.out.println(0x1);
System.out.println(encrypt("xrdba",KEY)); System.out.println(encrypt("xrdba",KEY));
String encryptData = encrypt("XR123456xr", KEY); String encryptData = encrypt("Aidea@2017", KEY);
System.out.println("加密后: " + encryptData); System.out.println("加密后: " + encryptData);
String decryptData = decrypt("W1yXo/+FlJFDyCmGhUWK0vs75T8N4+SZ", KEY); String decryptData = decrypt("OJpVPXowrqbtWtkdi3wt5A==", KEY);
System.out.println("解密后: " + decryptData); System.out.println("解密后: " + decryptData);
} }
} }
...@@ -96,8 +96,8 @@ public class EnDecryptUtils { ...@@ -96,8 +96,8 @@ public class EnDecryptUtils {
* *
*/ */
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
String KEY = "abcdefgabcdefg12"; String KEY = "schaffler@952710";
String content = "hello world"; //0gqIDaFNAAmwvv3tKsFOFf9P9m/6MWlmtB8SspgxqpWKYnELb/lXkyXm7P4sMf3e String content = "Aidea@2017"; //0gqIDaFNAAmwvv3tKsFOFf9P9m/6MWlmtB8SspgxqpWKYnELb/lXkyXm7P4sMf3e
System.out.println("加密前:" + content); System.out.println("加密前:" + content);
System.out.println("加密密钥和解密密钥:" + KEY); System.out.println("加密密钥和解密密钥:" + KEY);
......
...@@ -14,10 +14,10 @@ public class SystemConfig { ...@@ -14,10 +14,10 @@ public class SystemConfig {
try { try {
// inputStream = SystemConfig.class.newInstance().getClass() // inputStream = SystemConfig.class.newInstance().getClass()
// .getClassLoader().getResourceAsStream(""); // .getClassLoader().getResourceAsStream("");
p.load(new InputStreamReader(SystemConfig.class.getClassLoader().getResourceAsStream("/common-test.properties"), "utf-8")); p.load(new InputStreamReader(SystemConfig.class.getClassLoader().getResourceAsStream("/common.properties"), "utf-8"));
inputStreamRedis = SystemConfig.class.newInstance().getClass() inputStreamRedis = SystemConfig.class.newInstance().getClass()
.getClassLoader().getResourceAsStream("/redis-config-test.properties"); .getClassLoader().getResourceAsStream("/redis-config.properties");
r.load(inputStreamRedis); r.load(inputStreamRedis);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -302,10 +302,10 @@ ...@@ -302,10 +302,10 @@
src="plugins/ueditor-min-1.4.3/ueditor.config.js"></script> src="plugins/ueditor-min-1.4.3/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" <script type="text/javascript" charset="utf-8"
src="plugins/ueditor-min-1.4.3/ueditor.all.js"></script> src="plugins/ueditor-min-1.4.3/ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" <!--<script type="text/javascript" charset="utf-8"-->
src="plugins/ueditor-min-1.4.3/p/main.js"></script> <!--src="plugins/ueditor-min-1.4.3/p/main.js"></script>-->
<script type="text/javascript" charset="utf-8" <!--<script type="text/javascript" charset="utf-8"-->
src="plugins/ueditor-min-1.4.3/q/main.js"></script> <!--src="plugins/ueditor-min-1.4.3/q/main.js"></script>-->
<!-- Uedit End --> <!-- Uedit End -->
<script src="js/jquery.serializejson.js"></script> <script src="js/jquery.serializejson.js"></script>
...@@ -326,8 +326,8 @@ ...@@ -326,8 +326,8 @@
var smallimg = "$!{data.smallimg}"; var smallimg = "$!{data.smallimg}";
coverPP = new uePicPicker({ coverPP = new uePicPicker({
tarId: 'smallimg', tarId: 'smallimg',
title: '文章图', title: '文章封面图',
sizeDes: '205*202', sizeDes: "大图(390*170); 小图(170*90)",
max: 1, max: 1,
datas: smallimg == '' ? null : smallimg.split(","), datas: smallimg == '' ? null : smallimg.split(","),
success: null success: null
...@@ -350,7 +350,6 @@ ...@@ -350,7 +350,6 @@
toolbars: [[ toolbars: [[
'insertimage', 'insertimage',
'insertvideo', 'insertvideo',
'redo', //重做
'bold', //加粗 'bold', //加粗
'indent', //首行缩进 'indent', //首行缩进
'italic', //斜体 'italic', //斜体
...@@ -361,16 +360,12 @@ ...@@ -361,16 +360,12 @@
'superscript', //上标 'superscript', //上标
'formatmatch', //格式刷 'formatmatch', //格式刷
'source', //源代码 'source', //源代码
'blockquote', //引用
'pasteplain', //纯文本粘贴模式
'selectall', //全选
'print', //打印
'preview', //预览 'preview', //预览
'horizontal', //分隔线 'horizontal', //分隔线
'removeformat', //清除格式 'removeformat', //清除格式
'time', //时间 // 'time', //时间
'date', //日期 // 'date', //日期
'unlink', //取消链接
'insertrow', //前插入行 'insertrow', //前插入行
'insertcol', //前插入列 'insertcol', //前插入列
'mergeright', //右合并单元格 'mergeright', //右合并单元格
...@@ -386,16 +381,17 @@ ...@@ -386,16 +381,17 @@
'deletetable', //删除表格 'deletetable', //删除表格
'cleardoc', //清空文档 'cleardoc', //清空文档
'insertparagraphbeforetable', //"表格前插入行" 'insertparagraphbeforetable', //"表格前插入行"
'insertcode', //代码语言 // 'insertcode', //代码语言
'fontfamily', //字体 'fontfamily', //字体
'fontsize', //字号 'fontsize', //字号
'paragraph', //段落格式 'paragraph', //段落格式
'edittable', //表格属性 'edittable', //表格属性
'edittd', //单元格属性 'edittd', //单元格属性
'link', //超链接 'link', //超链接
'unlink', //取消链接
'emotion', //表情 'emotion', //表情
'spechars', //特殊字符 'spechars', //特殊字符
'insertvideo', //视频 // 'insertvideo', //视频
'justifyleft', //居左对齐 'justifyleft', //居左对齐
'justifyright', //居右对齐 'justifyright', //居右对齐
...@@ -411,13 +407,13 @@ ...@@ -411,13 +407,13 @@
'rowspacingtop', //段前距 'rowspacingtop', //段前距
'rowspacingbottom', //段后距 'rowspacingbottom', //段后距
'pagebreak', //分页 'pagebreak', //分页
'insertframe', //插入Iframe // 'insertframe', //插入Iframe
'imagenone', //默认 'imagenone', //默认
'imageleft', //左浮动 'imageleft', //左浮动
'imageright', //右浮动 'imageright', //右浮动
'attachment', //附件 // 'attachment', //附件
'imagecenter', //居中 'imagecenter', //居中
'wordimage', //图片转存 // 'wordimage', //图片转存
'lineheight', //行间距 'lineheight', //行间距
'edittip ', //编辑提示 'edittip ', //编辑提示
'customstyle', //自定义标题 'customstyle', //自定义标题
...@@ -426,8 +422,8 @@ ...@@ -426,8 +422,8 @@
'tolowercase', //字母小写 'tolowercase', //字母小写
'inserttable', //插入表格 'inserttable', //插入表格
'drafts', // 从草稿箱加载 //'drafts', // 从草稿箱加载
'charts', // 图表 //'charts', // 图表
]] ]]
}); });
//数据 //数据
......
...@@ -224,7 +224,7 @@ ...@@ -224,7 +224,7 @@
coverPP = new uePicPicker({ coverPP = new uePicPicker({
tarId: 'img', tarId: 'img',
title: '栏目小图', title: '栏目小图',
sizeDes: '205*202', sizeDes: '35*35',
max: 1, max: 1,
datas: smallimg=='' ? null : smallimg.split(","), datas: smallimg=='' ? null : smallimg.split(","),
success: null success: null
......
...@@ -14,8 +14,6 @@ import com.cftech.core.generic.GenericServiceImpl; ...@@ -14,8 +14,6 @@ import com.cftech.core.generic.GenericServiceImpl;
import com.cftech.core.sql.Conds; import com.cftech.core.sql.Conds;
import com.cftech.core.sql.Sort; import com.cftech.core.sql.Sort;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang.StringUtils;
import org.owasp.esapi.ESAPI; import org.owasp.esapi.ESAPI;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
......
...@@ -2,6 +2,7 @@ package com.cftech.base.codingrule.utils; ...@@ -2,6 +2,7 @@ package com.cftech.base.codingrule.utils;
import com.cftech.base.codingrule.model.Codingrule; import com.cftech.base.codingrule.model.Codingrule;
import com.cftech.base.codingrule.service.CodingruleService; import com.cftech.base.codingrule.service.CodingruleService;
import com.cftech.core.util.SpringContextHolder;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate; import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.StringRedisSerializer; import org.springframework.data.redis.serializer.StringRedisSerializer;
...@@ -65,4 +66,44 @@ public class CodingruleUtils { ...@@ -65,4 +66,44 @@ public class CodingruleUtils {
tpl = tpl.substring(0, tpl.length() - number.length()) + number; tpl = tpl.substring(0, tpl.length() - number.length()) + number;
return tpl; return tpl;
} }
/**
* 粉丝别名生成规则
* 年份后两位+月份两位+四位数从0开始排序
* @return
*/
public String getAlias() {
String dateFormatStr = "yyMM";
SimpleDateFormat sdf = new SimpleDateFormat(dateFormatStr);
String today = sdf.format(new Date());
String key = "FANSS_ENTITY_NUMBER";
String tplNum = "0000";
long count = getConfig().opsForValue().increment(key, 1);
String number = String.valueOf(count);
number = today + tplNum.substring(0, tplNum.length() - number.length()) + number;
System.out.println(number);
return number;
}
// public static void main(String[] args) {
// RedisTemplate<String, String> redisTemplate = SpringContextHolder.getBean(RedisTemplate.class);
// StringRedisSerializer stringSerializer = new StringRedisSerializer();
// redisTemplate.setKeySerializer(stringSerializer);
//// redisTemplate.setValueSerializer(stringSerializer);
// redisTemplate.setHashKeySerializer(stringSerializer);
// redisTemplate.setHashValueSerializer(stringSerializer);
//
// String dateFormatStr = "yyMM";
// SimpleDateFormat sdf = new SimpleDateFormat(dateFormatStr);
// String today = sdf.format(new Date());
//
//
// String key = "FANSS_ENTITY_NUMBER";
// String tplNum = "0000";
// long count = redisTemplate.opsForValue().increment(key, 1);
// String number = String.valueOf(count);
// number = today + tplNum.substring(0, tplNum.length() - number.length()) + number;
// System.out.println(number);
// //getAlias();
// }
} }
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<form id="seachTableForm" action="#springUrl('/a/materialUpload/list')" method="get"> <form id="seachTableForm" action="#springUrl('/a/materialUpload/list')" method="get">
<div class="col-xs-2" style="display: none"> <div class="col-xs-2" style="display: none">
<input type="text" class="form-control required" <input type="text" class="form-control required"
name="categoryid" id="categoryid" value="0"> name="categoryid" id="categoryid" value="$!{categoryid}">
<input type="text" class="form-control required" <input type="text" class="form-control required"
name="categoryName" id="categoryName" placeholder="categoryName" value="素材分类"> name="categoryName" id="categoryName" placeholder="categoryName" value="素材分类">
</div> </div>
...@@ -170,6 +170,13 @@ ...@@ -170,6 +170,13 @@
var csrftoken = {name: '_csrf', value: '${_csrf.token}'}; var csrftoken = {name: '_csrf', value: '${_csrf.token}'};
</script> </script>
<script> <script>
var categoryid = `$!{categoryid}`;
// if (categoryid != null && categoryid != '') {
// let zTree = $('#zTree');
// var node = zTree.getNodeByParam("id", categoryid);
// zTree.selectNode(node);
// }
function formatDates(now) { function formatDates(now) {
var now = new Date(now); var now = new Date(now);
var year = now.getFullYear(); var year = now.getFullYear();
...@@ -343,7 +350,13 @@ ...@@ -343,7 +350,13 @@
return node.level == 0; return node.level == 0;
}, true), true, false, false); }, true), true, false, false);
var nodes = tree.getNodes(); var nodes = tree.getNodes();
if (categoryid != null && categoryid != '') {
var node = tree.getNodeByParam("id", categoryid);
tree.selectNode(node);
} else {
tree.selectNode(nodes[0]); //选中第一个子节点 tree.selectNode(nodes[0]); //选中第一个子节点
}
}; };
getTreeData(); getTreeData();
} }
...@@ -366,7 +379,8 @@ ...@@ -366,7 +379,8 @@
message: "删除成功", message: "删除成功",
btntext: "确定", btntext: "确定",
success: function () { success: function () {
location.href = "#springUrl('/a/materialUpload/list')"; let id = $('#categoryid').val();
location.href = '#springUrl("/a/materialUpload/list?categoryid='+id+'")';
} }
}); });
} }
......
...@@ -76,8 +76,8 @@ public class MaterialUploadController { ...@@ -76,8 +76,8 @@ public class MaterialUploadController {
//列表页面 //列表页面
@RequestMapping("/list") @RequestMapping("/list")
@RequiresPermissions(value = MATERIAL_VIEW) @RequiresPermissions(value = MATERIAL_VIEW)
public String list(HttpServletRequest request, Model model) { public String list(HttpServletRequest request, Model model, Long categoryid) {
request.setAttribute("categoryid", categoryid == null ? 0L : categoryid);
return "upload/materialUploadlist"; return "upload/materialUploadlist";
} }
......
...@@ -189,7 +189,6 @@ ...@@ -189,7 +189,6 @@
LEFT JOIN area a ON t.province_id = a.areaid LEFT JOIN area a ON t.province_id = a.areaid
LEFT JOIN area b ON t.city_id = b.areaid LEFT JOIN area b ON t.city_id = b.areaid
LEFT JOIN area c ON t.area_id = c.areaid LEFT JOIN area c ON t.area_id = c.areaid
and t.del_flag=0
WHERE t.id=#{id} WHERE t.id=#{id}
</select> </select>
......
...@@ -336,7 +336,7 @@ ...@@ -336,7 +336,7 @@
'</button>\n' + '</button>\n' +
'<ul class="dropdown-menu" role="menu">\n'; '<ul class="dropdown-menu" role="menu">\n';
html += '<li><a href="#springUrl("/a/address/form?id=' + a + '")">查看</a></li>'; html += '<li><a href="#springUrl("/a/address/form?id=' + a + '")">查看</a></li>';
html += '<li><a href="javascript:removeData(' + a + ')">删除</a></li>'; // html += '<li><a href="javascript:removeData(' + a + ')">删除</a></li>';
html += '</ul>'; html += '</ul>';
html += '#end'; html += '#end';
return html; return html;
......
...@@ -114,12 +114,12 @@ ...@@ -114,12 +114,12 @@
<a style="width: 15%;-webkit-box-flex: 0; margin-left: 20px; margin-top: 2px;float:left" <a style="width: 15%;-webkit-box-flex: 0; margin-left: 20px; margin-top: 2px;float:left"
class="btn btn-primary btn-sm" id="areaselect">选择</a> class="btn btn-primary btn-sm" id="areaselect">选择</a>
</div> </div>
<div class="form-group form-md-line-input" style="display:none" id="massSendTag"> <!--<div class="form-group form-md-line-input" style="display:none" id="massSendTag">-->
<label style="clear:both;width:100%">选择标签</label> <!--<label style="clear:both;width:100%">选择标签</label>-->
<select class="form-control select2" multiple='multiple' style="width: 100%" <!--<select class="form-control select2" multiple='multiple' style="width: 100%"-->
id="addlabel" name="tags" data-placeholder='请选择标签'> <!--id="addlabel" name="tags" data-placeholder='请选择标签'>-->
</select> <!--</select>-->
</div> <!--</div>-->
<div class="form-group form-md-line-input" id="storeDiv" style="display:none"> <div class="form-group form-md-line-input" id="storeDiv" style="display:none">
<label>所属门店</label> <label>所属门店</label>
<div class="input-group"> <div class="input-group">
...@@ -423,7 +423,7 @@ ...@@ -423,7 +423,7 @@
message: "预览文章发送成功,请在手机上查看", message: "预览文章发送成功,请在手机上查看",
btntext: "确定", btntext: "确定",
success: function () { success: function () {
location.href = "#springUrl('/a/cfarticle/list')"; location.href = "#springUrl('/a/article/list')";
} }
}); });
} }
......
...@@ -2,12 +2,14 @@ package com.cftech.mp.article.service; ...@@ -2,12 +2,14 @@ package com.cftech.mp.article.service;
import com.cftech.core.generic.GenericService; import com.cftech.core.generic.GenericService;
import com.cftech.mp.article.model.MpArticle; import com.cftech.mp.article.model.MpArticle;
/** /**
* 素材管理Service * 素材管理Service
* *
* @author lisw * @author lisw
* @date: 2017-04-18 17:37 * @date: 2017-04-18 17:37
*/ */
public interface ArticleService extends GenericService<MpArticle> { public interface ArticleService extends GenericService<MpArticle> {
Integer updateSynsTable(String accessToken,Long accountsId);
Integer updateSynsTable(String accessToken, Long accountsId);
} }
...@@ -348,7 +348,7 @@ ...@@ -348,7 +348,7 @@
</if> </if>
where fanss.delflag=0 and fanss.mpaccountid=${accountsid} where fanss.delflag=0 and fanss.mpaccountid=${accountsid}
<if test="areaName!=null and areaName!=''"> <if test="areaName!=null and areaName!=''">
and ((find_in_set(city,#{areaName})) or (find_in_set(province,#{areaName}))) and ((find_in_set( CONVERT(AES_DECRYPT(city,'aideakey') USING UTF8) ,#{areaName})) or (find_in_set( CONVERT(AES_DECRYPT(province,'aideakey') USING UTF8),#{areaName})))
</if> </if>
<if test="sex!=null and sex!=''"> <if test="sex!=null and sex!=''">
and fanss.sex=${sex} and fanss.sex=${sex}
......
...@@ -2,6 +2,7 @@ package com.cftech.mp.reply.service; ...@@ -2,6 +2,7 @@ package com.cftech.mp.reply.service;
import com.cftech.accounts.model.MpAccountsEntity; import com.cftech.accounts.model.MpAccountsEntity;
import com.cftech.accounts.service.MpAccountsService; import com.cftech.accounts.service.MpAccountsService;
import com.cftech.base.codingrule.utils.CodingruleUtils;
import com.cftech.base.org.model.OrgUnit; import com.cftech.base.org.model.OrgUnit;
import com.cftech.base.org.model.Qyuser; import com.cftech.base.org.model.Qyuser;
import com.cftech.base.org.service.OrgUnitService; import com.cftech.base.org.service.OrgUnitService;
...@@ -89,6 +90,9 @@ public class CoreService { ...@@ -89,6 +90,9 @@ public class CoreService {
@Autowired @Autowired
private CfarticleService cfarticleService; private CfarticleService cfarticleService;
@Autowired
private CodingruleUtils codingruleUtils;
// @Autowired // @Autowired
// private CardRecordService cardRecordService; // private CardRecordService cardRecordService;
// //
...@@ -198,15 +202,15 @@ public class CoreService { ...@@ -198,15 +202,15 @@ public class CoreService {
mpFanssService.deleteByOpenId(fromUserName); mpFanssService.deleteByOpenId(fromUserName);
return ""; return "";
} else if (eventType.equals(MessageUtil.EVENT_TYPE_CLICK)) {// 自定义菜单点击事件 } else if (eventType.equals(MessageUtil.EVENT_TYPE_CLICK)) {// 自定义菜单点击事件
// Menu menu = menuServices.fetchById(eventKey); Menu menu = menuServices.fetchById(eventKey);
// if (StringUtils.equals(menu.getMsgType(), "1")) { if (StringUtils.equals(menu.getMsgType(), "1")) {
// String content = MessageUtil.textMessageToXml(text(fromUserName, toUserName, menu.getSourceContent())); String content = MessageUtil.textMessageToXml(text(fromUserName, toUserName, menu.getSourceContent()));
// return content; return content;
// } else if (StringUtils.equals(menu.getMsgType(), "2")) { } else if (StringUtils.equals(menu.getMsgType(), "2")) {
// return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, menu.getSourceContent())); return MessageUtil.newsMessageToXml(news(fromUserName, toUserName, menu.getSourceContent()));
// } else if (StringUtils.equals(menu.getMsgType(), "3")) { } else if (StringUtils.equals(menu.getMsgType(), "3")) {
// return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, menu.getSourceContent())); return MessageUtil.newsMessageToXml(localNews(fromUserName, toUserName, menu.getSourceContent()));
// } }
} else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_GET_CARD)) {//用户领取卡券 } else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_GET_CARD)) {//用户领取卡券
} else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_GIFTING_CARD)) {//用户转赠卡券 } else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_GIFTING_CARD)) {//用户转赠卡券
} else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_CONSUME_CARD)) {//核销卡券 } else if (eventType.equals(MessageUtil.EVENT_TYPE_USER_CONSUME_CARD)) {//核销卡券
...@@ -562,7 +566,11 @@ public class CoreService { ...@@ -562,7 +566,11 @@ public class CoreService {
MpFanssEntity fannsEntity = new MpFanssEntity(); MpFanssEntity fannsEntity = new MpFanssEntity();
//增加粉丝别名 //增加粉丝别名
if (fansList != null && fansList.size() > 0) { if (fansList != null && fansList.size() > 0) {
if (StringUtils.isNoneBlank(fansList.get(0).getStore())) {
fannsEntity.setStore(fansList.get(0).getStore()); fannsEntity.setStore(fansList.get(0).getStore());
} else {
fannsEntity.setStore(codingruleUtils.getAlias());
}
} }
fannsEntity.setHeadimgurl(user.getHeadimgurl()); fannsEntity.setHeadimgurl(user.getHeadimgurl());
......
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<div class="box-tools pull-right"> <div class="box-tools pull-right">
#if($shiro.hasPermission("sys:orgunit:edit")) #if($shiro.hasPermission("sys:orgunit:edit"))
<a href="#springUrl('/a/orgunit/form')" class="btn btn-primary">新增</a> <a onclick="addDept()" class="btn btn-primary">新增</a>
<a onclick="importExcel();" class="btn btn-primary">导入</a> <a onclick="importExcel();" class="btn btn-primary">导入</a>
#end #end
...@@ -198,6 +198,15 @@ ...@@ -198,6 +198,15 @@
<script src="dist/js/demo.js"></script> <script src="dist/js/demo.js"></script>
<script> <script>
function addDept(){
var orgId = $("#orgid").val();
if (orgId == null || orgId == "") {
orgId = 0;
}
location.href = "#springUrl('/a/orgunit/form')?parentId="+orgId;
}
function formatDates(now) { function formatDates(now) {
var now = new Date(now); var now = new Date(now);
var year = now.getFullYear(); var year = now.getFullYear();
......
...@@ -565,6 +565,7 @@ ...@@ -565,6 +565,7 @@
if ($("#passwordQyUser").val() != null && $("#passwordQyUser").val() != "") { if ($("#passwordQyUser").val() != null && $("#passwordQyUser").val() != "") {
var password = sha256_digest($("#passwordQyUser").val()); var password = sha256_digest($("#passwordQyUser").val());
$("#passwordQyUser").val(password); $("#passwordQyUser").val(password);
dataJson.passwordQyUser = password;
} }
$.post("#springUrl('/a/qyuser/formData')", dataJson, function (returnobj) { $.post("#springUrl('/a/qyuser/formData')", dataJson, function (returnobj) {
$("#save").attr("disabled", false); $("#save").attr("disabled", false);
......
...@@ -68,17 +68,15 @@ public class OrgUnitController { ...@@ -68,17 +68,15 @@ public class OrgUnitController {
//返回编辑页面(新增、修改) //返回编辑页面(新增、修改)
@RequiresPermissions(value = PermissionSign.ORGUNIT_VIEW) @RequiresPermissions(value = PermissionSign.ORGUNIT_VIEW)
@RequestMapping(value = "/form",method = {RequestMethod.GET,RequestMethod.POST}) @RequestMapping(value = "/form",method = {RequestMethod.GET,RequestMethod.POST})
public String form(HttpServletRequest request, String id, Model model) { public String form(HttpServletRequest request, String id, Model model, String parentId) {
Long accountsId = Long.parseLong(qyAccounts); Long accountsId = Long.parseLong(qyAccounts);
Sort sort = new Sort("number", OrderType.ASC); Sort sort = new Sort("number", OrderType.ASC);
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("del_flag", 0); conds.equal("del_flag", 0);
if (!StringUtils.isEmpty(id)) { if (!StringUtils.isEmpty(id)) {
OrgUnit orgUnit = orgUnitService.fetchById(id); OrgUnit orgUnit = orgUnitService.fetchById(id);
String parentOrgName = ""; String parentOrgName = "";
if (orgUnit.getParentId() == 0) { if (orgUnit.getParentId() == 0) {
parentOrgName = rootOrgName; parentOrgName = rootOrgName;
} else { } else {
...@@ -94,6 +92,16 @@ public class OrgUnitController { ...@@ -94,6 +92,16 @@ public class OrgUnitController {
model.addAttribute("accountId", orgUnit.getAccountsId()); model.addAttribute("accountId", orgUnit.getAccountsId());
conds.equal("accounts_id", orgUnit.getAccountsId()); conds.equal("accounts_id", orgUnit.getAccountsId());
} else { } else {
if (parentId.equals("0")) {
OrgUnit orgUnit = new OrgUnit();
orgUnit.setParentId(0L);
model.addAttribute("data", orgUnit);
model.addAttribute("parentName", rootOrgName);
} else {
OrgUnit orgUnit = orgUnitService.fetchById(parentId);
model.addAttribute("data", orgUnit);
model.addAttribute("parentName", orgUnit.getOrgName());
}
model.addAttribute("accountId", accountsId); model.addAttribute("accountId", accountsId);
conds.equal("accounts_id", accountsId); conds.equal("accounts_id", accountsId);
} }
......
...@@ -145,8 +145,7 @@ public class QyuserController { ...@@ -145,8 +145,7 @@ public class QyuserController {
qyuser.setWxuserId(loginNameQyUser); qyuser.setWxuserId(loginNameQyUser);
qyUserUtil.updateQyUser(qyuser); qyUserUtil.updateQyUser(qyuser);
if (!StringUtils.isEmpty(qyuser.getImg())) { if (!StringUtils.isEmpty(qyuser.getImg())) {
String domainName = SystemConfig.p.getProperty("QY_DOMAIN"); qyuser.setDescription(qyuser.getImg().contains("http") ? qyuser.getImg():SystemConfig.p.getProperty("QY_DOMAIN") + qyuser.getImg());
qyuser.setDescription(domainName + qyuser.getImg());
} }
qyuserService.update(qyuser); qyuserService.update(qyuser);
if (!StringUtils.isEmpty(loginNameQyUser)) { if (!StringUtils.isEmpty(loginNameQyUser)) {
...@@ -181,15 +180,18 @@ public class QyuserController { ...@@ -181,15 +180,18 @@ public class QyuserController {
qyuser.setWxuserId(loginNameQyUser); qyuser.setWxuserId(loginNameQyUser);
//同步至企业微信 //同步至企业微信
qyUserUtil.updateQyUser(qyuser); qyUserUtil.updateQyUser(qyuser);
user.setPassword(passwordQyUser);
user.setUsername(loginNameQyUser);
user.setState("0");
if (!StringUtils.isEmpty(qyuser.getImg())) { if (!StringUtils.isEmpty(qyuser.getImg())) {
String domainName = SystemConfig.p.getProperty("QY_DOMAIN"); qyuser.setDescription(qyuser.getImg().contains("http") ? qyuser.getImg():SystemConfig.p.getProperty("QY_DOMAIN") + qyuser.getImg());
qyuser.setDescription(domainName + qyuser.getImg());
} }
qyuserService.save(qyuser); qyuserService.save(qyuser);
//添加本地用户
user.setState("0");
user.setPassword(passwordQyUser);
user.setUsername(loginNameQyUser);
user.setUserid(qyuser.getId()); user.setUserid(qyuser.getId());
user.setAccountsid(UserUtils.getmpaccounts(request));
user.setDefaultAccId(UserUtils.getmpaccounts(request)); user.setDefaultAccId(UserUtils.getmpaccounts(request));
userService.save(user); userService.save(user);
rtnJson.put("errorNo", 2); rtnJson.put("errorNo", 2);
......
...@@ -177,7 +177,7 @@ function formSubmit (data) ...@@ -177,7 +177,7 @@ function formSubmit (data)
btnoktext: "确定", btnoktext: "确定",
btncanceltext: "关闭", btncanceltext: "关闭",
success: function () { success: function () {
location.href = "#springUrl('/a/index')"; top.location.href = "#springUrl('/a/index')";
}, },
cancel: function () { cancel: function () {
} }
......
...@@ -89,7 +89,9 @@ public class UserController { ...@@ -89,7 +89,9 @@ public class UserController {
* 验证码 * 验证码
*/ */
@GetMapping("captcha.jpg") @GetMapping("captcha.jpg")
public void captcha(HttpServletRequest request,HttpServletResponse response, String uuid)throws ServletException, IOException { public void captcha(HttpServletRequest request,HttpServletResponse response, String uuid) {
try {
Assert.hasText(uuid, "uuid不能为空"); Assert.hasText(uuid, "uuid不能为空");
if(uuid.contains("..")||uuid.contains("/")|| uuid.contains("%00")) if(uuid.contains("..")||uuid.contains("/")|| uuid.contains("%00"))
{ {
...@@ -119,6 +121,10 @@ public class UserController { ...@@ -119,6 +121,10 @@ public class UserController {
ServletOutputStream out = response.getOutputStream(); ServletOutputStream out = response.getOutputStream();
ImageIO.write(image, "jpg", out); ImageIO.write(image, "jpg", out);
IOUtils.closeQuietly(out); IOUtils.closeQuietly(out);
} catch (IOException e) {
logger.error("验证码失败:" + e.getMessage());
e.printStackTrace();
}
} }
/** /**
* 用户登录 * 用户登录
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment